@@ -312,8 +312,7 @@ public boolean isIterableIntent(Intent intent) {
312312 }
313313
314314 /**
315- * Registers an existing device token with Iterable.
316- * Recommended to use registerForPush if you do not already have a deviceToken
315+ * Registers a device token with Iterable.
317316 * @param applicationName
318317 * @param token
319318 */
@@ -322,8 +321,7 @@ public void registerDeviceToken(String applicationName, String token) {
322321 }
323322
324323 /**
325- * Registers an existing device token with Iterable.
326- * Recommended to use registerForPush if you do not already have a deviceToken
324+ * Registers a device token with Iterable.
327325 * @param applicationName
328326 * @param token
329327 * @param pushServicePlatform
@@ -503,8 +501,6 @@ public void registerForPush(String iterableAppId, String projectNumber, String p
503501 /**
504502 * Disables the device from push notifications
505503 *
506- * The disablePush call
507- *
508504 * @param iterableAppId
509505 * @param gcmProjectNumber
510506 */
@@ -515,8 +511,6 @@ public void disablePush(String iterableAppId, String gcmProjectNumber) {
515511 /**
516512 * Disables the device from push notifications
517513 *
518- * The disablePush call
519- *
520514 * @param iterableAppId
521515 * @param projectNumber
522516 * @param pushServicePlatform
@@ -683,50 +677,14 @@ protected void disablePush(String token) {
683677 sendPostRequest (IterableConstants .ENDPOINT_DISABLE_DEVICE , requestJSON );
684678 }
685679
686- //---------------------------------------------------------------------------------------
687- //endregion
688-
689- //region Private Fuctions
690- //---------------------------------------------------------------------------------------
691-
692- /**
693- * Updates the data for the current user.
694- * @param context
695- * @param apiKey
696- * @param email
697- * @param userId
698- */
699- private void updateData (Context context , String apiKey , String email , String userId ) {
700-
701- this ._applicationContext = context ;
702- this ._apiKey = apiKey ;
703- this ._email = email ;
704- this ._userId = userId ;
705- }
706-
707- /**
708- * Attempts to track a notifOpened event from the called Intent.
709- * @param calledIntent
710- */
711- private void tryTrackNotifOpen (Intent calledIntent ) {
712- Bundle extras = calledIntent .getExtras ();
713- if (extras != null ) {
714- Intent intent = new Intent ();
715- intent .setClass (_applicationContext , IterablePushOpenReceiver .class );
716- intent .setAction (IterableConstants .ACTION_NOTIF_OPENED );
717- intent .putExtras (extras );
718- _applicationContext .sendBroadcast (intent );
719- }
720- }
721-
722680 /**
723681 * Registers the GCM registration ID with Iterable.
724682 * @param applicationName
725683 * @param token
726684 * @param pushServicePlatform
727685 * @param dataFields
728686 */
729- public void registerDeviceToken (String applicationName , String token , String pushServicePlatform , JSONObject dataFields ) {
687+ protected void registerDeviceToken (String applicationName , String token , String pushServicePlatform , JSONObject dataFields ) {
730688 String platform = IterableConstants .MESSAGING_PLATFORM_GOOGLE ;
731689
732690 JSONObject requestJSON = new JSONObject ();
@@ -761,6 +719,42 @@ public void registerDeviceToken(String applicationName, String token, String pus
761719 sendPostRequest (IterableConstants .ENDPOINT_REGISTER_DEVICE_TOKEN , requestJSON );
762720 }
763721
722+ //---------------------------------------------------------------------------------------
723+ //endregion
724+
725+ //region Private Fuctions
726+ //---------------------------------------------------------------------------------------
727+
728+ /**
729+ * Updates the data for the current user.
730+ * @param context
731+ * @param apiKey
732+ * @param email
733+ * @param userId
734+ */
735+ private void updateData (Context context , String apiKey , String email , String userId ) {
736+
737+ this ._applicationContext = context ;
738+ this ._apiKey = apiKey ;
739+ this ._email = email ;
740+ this ._userId = userId ;
741+ }
742+
743+ /**
744+ * Attempts to track a notifOpened event from the called Intent.
745+ * @param calledIntent
746+ */
747+ private void tryTrackNotifOpen (Intent calledIntent ) {
748+ Bundle extras = calledIntent .getExtras ();
749+ if (extras != null ) {
750+ Intent intent = new Intent ();
751+ intent .setClass (_applicationContext , IterablePushOpenReceiver .class );
752+ intent .setAction (IterableConstants .ACTION_NOTIF_OPENED );
753+ intent .putExtras (extras );
754+ _applicationContext .sendBroadcast (intent );
755+ }
756+ }
757+
764758 /**
765759 * Sends the POST request to Iterable.
766760 * Performs network operations on an async thread instead of the main thread.
0 commit comments