use of com.onesignal.OneSignal.ChangeTagsUpdateHandler in project OneSignal-Android-SDK by OneSignal.
the class UserStateSynchronizer method sendTagsHandlersPerformOnSuccess.
private void sendTagsHandlersPerformOnSuccess() {
JSONObject tags = OneSignalStateSynchronizer.getTags(false).result;
ChangeTagsUpdateHandler handler;
while ((handler = sendTagsHandlers.poll()) != null) handler.onSuccess(tags);
}
use of com.onesignal.OneSignal.ChangeTagsUpdateHandler in project OneSignal-Android-SDK by OneSignal.
the class MainOneSignalClassRunner method testNestedSendTagsOnSuccess.
@Test
public void testNestedSendTagsOnSuccess() throws Exception {
final JSONObject tags = new JSONObject().put("key", "value");
OneSignalInit();
OneSignal.sendTags(tags);
threadAndTaskWait();
// Sending same tags a 2nd time creates the issue, as it take a different code path
OneSignal.sendTags(tags, new ChangeTagsUpdateHandler() {
@Override
public void onSuccess(JSONObject values) {
OneSignal.sendTags(tags, new TestChangeTagsUpdateHandler());
}
@Override
public void onFailure(OneSignal.SendTagsError error) {
}
});
threadAndTaskWait();
}
Aggregations