I am attempting to add attributes to Marketing Cloud in the onETPushConfigurationSuccess() method in the application class. etRequestStatus.etPushSdkStatusCode = 0 and the application is able to receive push notification successfully but no attributes will update in the MobilePush Demographics. Is this the proper way to add attributes?
/** Register to receive push notifications. */
try {
ETPush.configureSdk(new ETPushConfig.Builder(this)
.setEtAppId(ET_APP_ID)
.setAccessToken(ET_ACCESS_TOKEN)
.setLogLevel(Log.VERBOSE)
.setGcmSenderId(FCM_SENDER_ID)
.setAnalyticsEnabled(false) // ET Analytics, default = false
.setWamaEnabled(false) // Web & Mobile Analytics, default = false
.build()
, new ETPushConfigureSdkListener() {
@Override
public void onETPushConfigurationSuccess(ETPush etPush, ETRequestStatus etRequestStatus) {
// Verify Google Play Services availability and notify the user of any exceptions
if (etRequestStatus.getGooglePlayServiceStatusCode() != ConnectionResult.SUCCESS && GoogleApiAvailability.getInstance().isUserResolvableError(etRequestStatus.getGooglePlayServiceStatusCode())) {
GoogleApiAvailability.getInstance().showErrorNotification(getApplicationContext(), etRequestStatus.getGooglePlayServiceStatusCode());
}
try {
boolean attributeAdded = etPush.addAttribute("MemberID", "12345678");
if (attributeAdded) {
Log.i("debug", "attribute added");
} else {
Log.i("debug", "attribute NOT added");
}
} catch (ETException e){
e.printStackTrace();
}
}
@Override
public void onETPushConfigurationFailed(ETException e) {
// If we're here then your application will _NOT_ receive push notifications.
Crashlytics.log(Log.ERROR, "onetech", e.getMessage());
}
}
);
} catch (ETException e) {
Crashlytics.log(Log.ERROR, "debug", e.getMessage());
}
Update: I am getting "attribute added" in the logs:
D/~!ETPush: configureSdk()
D/~!ETPush: Resuming as a result of callback? 'true'
D/~!ETPush: activityPausedThread is not running. So continue with resuming activity.
D/~!ETPush: activityResume thread started
D/~!uf: New instance of ETSqliteOpenHelper.
D/~!Registration: Platform: "Android", platformVersion: "5.1.1"
D/~!Registration: hwid: LGE LGLS675
D/~!Registration: Registration() initialization complete
D/~!ETPush: ETPush singleton getInstance initialization completed.
I/~!ud: SDK is ReadOnly: false
D/~!ETPush: Google Play Services Version Dependency: 10084000
I/~!ETPush: Google Play Services Runtime Available: SUCCESS
D/~!ETPush: Looking for android.intent.action.MY_PACKAGE_REPLACED Intent Filter
I/~!ETPush: Receivers Info Size: 31, Receiver Class Name: com.exacttarget.etpushsdk.ETPushReceiver, Package Name: net.onetechnologies.scoresense
I/~!ETPush: ActivityInfo Name: com.exacttarget.etpushsdk.ETPushReceiver, ActivityInfo Package: net.onetechnologies.scoresense
D/~!ETPush: Receiver com.exacttarget.etpushsdk.ETPushReceiver Found
D/~!ETPush: Looking for net.onetechnologies.scoresense.MESSAGE_OPENED Intent Filter
I/~!ETPush: Receivers Info Size: 1, Receiver Class Name: com.exacttarget.etpushsdk.ETPushReceiver, Package Name: net.onetechnologies.scoresense
I/~!ETPush: ActivityInfo Name: com.exacttarget.etpushsdk.ETPushReceiver, ActivityInfo Package: net.onetechnologies.scoresense
D/~!ETPush: Receiver com.exacttarget.etpushsdk.ETPushReceiver Found
D/~!ETPush: Looking for android.intent.action.AIRPLANE_MODE Intent Filter
I/~!ETPush: Receivers Info Size: 4, Receiver Class Name: com.exacttarget.etpushsdk.ETPushReceiver, Package Name: net.onetechnologies.scoresense
I/~!ETPush: ActivityInfo Name: com.lge.cmas.transaction.CmasAirplaneModeReceiver, ActivityInfo Package: com.lge.cmas
I/~!ETPush: ActivityInfo Name: com.lge.sprintextension.SprintExtensionBroadcastReceiver, ActivityInfo Package: com.lge.sprintextension
I/~!ETPush: ActivityInfo Name: com.locationlabs.v3client.AirPlaneReceiver, ActivityInfo Package: com.locationlabs.sparkle.yellow.pre
I/~!ETPush: ActivityInfo Name: com.exacttarget.etpushsdk.ETPushReceiver, ActivityInfo Package: net.onetechnologies.scoresense
D/~!ETPush: Receiver com.exacttarget.etpushsdk.ETPushReceiver Found
D/~!ETPush: Looking for android.intent.action.ACTION_SHUTDOWN Intent Filter
I/~!ETPush: Receivers Info Size: 7, Receiver Class Name: com.exacttarget.etpushsdk.ETPushReceiver, Package Name: net.onetechnologies.scoresense
I/~!ETPush: ActivityInfo Name: com.android.settings.powersave.PowerSaveReceiver, ActivityInfo Package: com.android.settings
I/~!ETPush: ActivityInfo Name: com.lge.clock.alarmclock.ALReceiver, ActivityInfo Package: com.lge.clock
I/~!ETPush: ActivityInfo Name: com.lge.clock.timer.TimerReceiver, ActivityInfo Package: com.lge.clock
I/~!ETPush: ActivityInfo Name: com.lge.camera.systeminput.MediaMountStateReceiver, ActivityInfo Package: com.lge.camera
I/~!ETPush: ActivityInfo Name: com.lge.contacts.sim.SimPhonebookStateReceiver, ActivityInfo Package: com.android.contacts
I/~!ETPush: ActivityInfo Name: com.lge.lgdmsclient.receiver.DmReceiver, ActivityInfo Package: com.lge.lgdmsclient
I/~!ETPush: ActivityInfo Name: com.exacttarget.etpushsdk.ETPushReceiver, ActivityInfo Package: net.onetechnologies.scoresense
D/~!ETPush: Receiver com.exacttarget.etpushsdk.ETPushReceiver Found
D/~!ETPush: checking classes for onEvent.
D/~!ETPush: confirmed classes for onEvent.
D/~!ETPush: checking classes for setDatabaseIds.
D/~!ETPush: confirmed classes for setDatabaseIds.
D/~!ETPush: checking classes for setId.
D/~!ETPush: confirmed classes for setId.
D/~!ETPush: configureSdk() initialization completed
D/~!ETPush: 1035331432 resuming started...
D/~!ETPush: Cancelling activityPausedPendingIntent
D/~!EventBus: Registering com.exacttarget.etpushsdk.ETPush with ET EventBus
D/~!ETPush: Current time: 1499357046650 Pause time: -1
D/~!ETPush: 1035331432 will notify that app came into foreground...
D/~!EventBus: postSticky(BackgroundEvent event)
D/~!EventBus: Registering complete com.exacttarget.etpushsdk.ETPush with ET EventBus
D/~!EventBus: post(BackgroundEvent event) with ET EventBus
V/~!uh: Verifying Google Play Services ...
D/~!EventBus: Invoking com.exacttarget.etpushsdk.ETPush.onEvent() with BackgroundEvent
D/~!ETPush: The application is coming into the foreground.
D/~!ETPush: Checking for pending registration data.
D/~!dh: Counting pending registrations.
D/~!dh: There are 1 pending registrations.
D/~!ETPush: We have pending registration data to send.
D/~!ETAlarmManager: Resetting REGISTRATION Alarm Interval to 1.00 minute(s).
D/~!ETAlarmManager: Resetting REGISTRATION Alarm Active Flag to FALSE
V/~!uh: Google Play Services is available and meets or exceeds the minimum required version.
D/~!ETPush: sendRegistration()
D/~!ETPush: Create Registration if we have a SystemToken.
D/~!ETAlarmManager: HARD RESET for REGISTRATION Alarm.
W/~!Registration: An empty or NULL Subscriber Key will not be transmitted to the Marketing Cloud and was NOT updated with the provided value.
D/~!ETPush: Creating Registration ...
I/debug: attribute added
D/~!ETAlarmManager: Resetting REGISTRATION Alarm Interval to 1.00 minute(s).
D/~!ETAlarmManager: Resetting REGISTRATION Alarm Active Flag to FALSE
D/~!dh: Counting pending registrations.
D/~!ETAlarmManager: HARD RESET for REGISTRATION Alarm.
D/~!uk: createHash(final String string) // string = '{"deviceID":"29257f7b578690c931e501eca9efad9","device_Token":"very long device token","sdk_version":"4.8.4","app_version":"2.3.8 : 209","gcmSenderId":"{gcm_sender_id}","dST":true,"location_enabled":false,"platform_Version":"5.1.1","push_enabled":true,"timeZone":-21600,"platform":"Android","hwid":"LGE LGLS675","etAppId":"{et_app_id}","badge":0,"locale":"en_US","tags":["ALL","Android","Debug"],"attributes":[{"key":"MemberID","value":"appMemberId"}]}'
D/~!uk: return f62721d758364c5cd4b01dc3f11167b8
D/~!dh: There are 1 pending registrations.
D/~!ETPush: There are saved Registrations. Delete all rows.
D/~!ETAlarmManager: shouldCreateAlarm() for REGISTRATION Alarm was FALSE. Aborting alarm creation.
D/~!EventBus: post(BackgroundEvent event) complete with ET EventBus
D/~!ETPush: 1035331432 resuming done...
D/~!ETPush: sendInternalRegistration()
D/~!ETPush: Create Registration if we have a SystemToken.
D/~!ETPush: Creating Registration ...
D/~!dh: Counting pending registrations.
D/~!dh: There are 1 pending registrations.
D/~!ETPush: There are saved Registrations. Delete all rows.
W/~!Registration: An empty or NULL Subscriber Key will not be transmitted to the Marketing Cloud and was NOT updated with the provided value.
D/~!uk: createHash(final String string) // string = '{"deviceID":"29257f7b578690c931e501eca9efad9","device_Token":"very long device token","sdk_version":"4.8.4","app_version":"2.3.8 : 209","gcmSenderId":"{gcm_sender_id}","dST":true,"location_enabled":false,"platform_Version":"5.1.1","push_enabled":true,"timeZone":-21600,"platform":"Android","hwid":"LGE LGLS675","etAppId":"{et_app_id}","badge":0,"locale":"en_US","tags":["ALL","Android","Debug"],"attributes":[{"key":"MemberID","value":"appMemberId"}]}'
D/~!uk: return f62721d758364c5cd4b01dc3f11167b8
D/~!ETAlarmManager: shouldCreateAlarm() for REGISTRATION Alarm was FALSE. Aborting alarm creation.
D/~!dh: Counting pending registrations.
D/~!dh: There are 1 pending registrations.
D/~!ETPush: There are saved Registrations. Create Alarm (if needed) to send them.
W/~!Registration: An empty or NULL Subscriber Key will not be transmitted to the Marketing Cloud and was NOT updated with the provided value.
D/~!uk: createHash(final String string) // string = '{"deviceID":"29257f7b578690c931e501eca9efad9","device_Token":"very long device token","sdk_version":"4.8.4","app_version":"2.3.8 : 209","gcmSenderId":"{gcm_sender_id}","dST":true,"location_enabled":false,"platform_Version":"5.1.1","push_enabled":true,"timeZone":-21600,"platform":"Android","hwid":"LGE LGLS675","etAppId":"{et_app_id}","badge":0,"locale":"en_US","tags":["ALL","Android","Debug"],"attributes":[{"key":"MemberID","value":"appMemberId"}]}'
D/~!uk: return f62721d758364c5cd4b01dc3f11167b8
D/~!ETAlarmManager: shouldCreateAlarm() for REGISTRATION Alarm was FALSE. Aborting alarm creation.
D/~!ETPush: Pausing as a result of callback? 'true'
D/~!ETPush: activityResumedThread is not running. So continue with pausing activity.
D/~!ETPush: 1035331432 resuming started...
D/~!ETPush: Set Alarm for 15 seconds from now to handle background work.
D/~!ETPush: Save time for onResume() to determine if in foreground.
D/~!ETPush: 1035331432 pausing done...
D/~!ETPush: Resuming as a result of callback? 'true'
D/~!ETPush: activityPausedThread is not running. So continue with resuming activity.
D/~!ETPush: activityResume thread started
D/~!ETPush: 59699254 resuming started...
D/~!ETPush: Cancelling activityPausedPendingIntent
D/~!ETPush: Current time: 1499357048335 Pause time: 1499357048197
D/~!ETPush: pause_time_key removed
D/~!ETPush: 59699254 resuming done...