partial void GetIdentifiers(UIButton sender) { var callback = new Action <ACPMobileVisitorId[]>(handleCallback); ACPIdentity.GetIdentifiers(callback); Console.WriteLine("GetIdentifiers Completed"); }
public void TestGetIdentifiers_Returns_SyncedIdentifiers() { // setup latch = new CountdownEvent(1); ACPIdentity.SyncIdentifier("id1", "value1", VisitorID.AuthenticationState.Authenticated); var ids = new Dictionary <string, string>(); ids.Add("id2", "value2"); ids.Add("id3", "value3"); ACPIdentity.SyncIdentifiers(ids); var ids2 = new Dictionary <string, string>(); ids2.Add("id4", "value4"); ids2.Add("id5", "value5"); ACPIdentity.SyncIdentifiers(ids2, VisitorID.AuthenticationState.LoggedOut); // test ACPIdentity.GetIdentifiers(new GetIdentifiersCallback()); latch.Wait(); latch.Dispose(); // verify Assert.That(retrievedVisitorIdentifiers, Is.StringContaining("[Id: value1, Type: id1, Origin: d_cid_ic, Authentication: AUTHENTICATED]")); Assert.That(retrievedVisitorIdentifiers, Is.StringContaining("[Id: value2, Type: id2, Origin: d_cid_ic, Authentication: UNKNOWN]")); Assert.That(retrievedVisitorIdentifiers, Is.StringContaining("[Id: value3, Type: id3, Origin: d_cid_ic, Authentication: UNKNOWN]")); Assert.That(retrievedVisitorIdentifiers, Is.StringContaining("[Id: value4, Type: id4, Origin: d_cid_ic, Authentication: LOGGED_OUT]")); Assert.That(retrievedVisitorIdentifiers, Is.StringContaining("[Id: value5, Type: id5, Origin: d_cid_ic, Authentication: LOGGED_OUT]")); }
public TaskCompletionSource <string> GetIdentifiers() { stringOutput = new TaskCompletionSource <string>(); var callback = new Action <ACPMobileVisitorId[]>(handleCallback); ACPIdentity.GetIdentifiers(callback); stringOutput.SetResult(""); return(stringOutput); }
public TaskCompletionSource <string> GetIdentifiers() { latch = new CountdownEvent(1); stringOutput = new TaskCompletionSource <string>(); ACPIdentity.GetIdentifiers(new GetIdentifiersCallback()); latch.Wait(1000); stringOutput.SetResult(callbackString); return(stringOutput); }
public void TestGetIdentifiers_Returns_SyncedIdentifiers() { // setup CountdownEvent latch = new CountdownEvent(1); string visitorIdsString = ""; ACPIdentity.SyncIdentifier("id1", "value1", ACPMobileVisitorAuthenticationState.Authenticated); var ids = new NSMutableDictionary <NSString, NSObject> { ["id2"] = new NSString("value2"), ["id3"] = new NSString("value3"), }; ACPIdentity.SyncIdentifiers(ids); var ids2 = new NSMutableDictionary <NSString, NSObject> { ["id4"] = new NSString("value4"), ["id5"] = new NSString("value5"), }; ACPIdentity.SyncIdentifiers(ids2, ACPMobileVisitorAuthenticationState.LoggedOut); // test ACPIdentity.GetIdentifiers(callback => { foreach (ACPMobileVisitorId id in callback) { visitorIdsString = visitorIdsString + "[Id: " + id.Identifier + ", Type: " + id.IdType + ", Origin: " + id.IdOrigin + ", Authentication: " + id.AuthenticationState + "]"; } latch.Signal(); }); latch.Wait(); latch.Dispose(); // verify Assert.That(visitorIdsString, Is.StringContaining("[Id: value1, Type: id1, Origin: d_cid_ic, Authentication: Authenticated]")); Assert.That(visitorIdsString, Is.StringContaining("[Id: value2, Type: id2, Origin: d_cid_ic, Authentication: Unknown]")); Assert.That(visitorIdsString, Is.StringContaining("[Id: value3, Type: id3, Origin: d_cid_ic, Authentication: Unknown]")); Assert.That(visitorIdsString, Is.StringContaining("[Id: value4, Type: id4, Origin: d_cid_ic, Authentication: LoggedOut]")); Assert.That(visitorIdsString, Is.StringContaining("[Id: value5, Type: id5, Origin: d_cid_ic, Authentication: LoggedOut]")); }
void getIdentifiers() { ACPIdentity.GetIdentifiers(HandleAdobeGetIdentifiersCallback); }