1

I want to change a contact status in Exacttarget from Opted-in to Opted-out using IOS SDK when I'm trying with this code nothing change, any help please ?

Thanks

-(void) setOptinPush

{
if ([[NSUserDefaults standardUserDefaults] boolForKey:kExacTargetPush]) {
[[ETPush pushManager] startListeningForApplicationNotifications];
[kAppDelegate registerForNotifications];
}
else {
[[ETPush pushManager] stopListeningForApplicationNotifications];
[[UIApplication sharedApplication] unregisterForRemoteNotifications]; //Disable Notif
}
}

- (void)registerForNotifications {
if(SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")) {
UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeBadge|UIUserNotificationTypeSound|UIUserNotificationTypeAlert categories:nil];
[[UIApplication sharedApplication] registerUserNotificationSettings:settings];
[[UIApplication sharedApplication] registerForRemoteNotifications];
}
else {
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:UIRemoteNotificationTypeAlert|UIRemoteNotificationTypeBadge|UIRemoteNotificationTypeSound];
}
if (exactTargetActivated) {
// IPHONEOS_DEPLOYMENT_TARGET = 6.X or 7.X
#if __IPHONE_OS_VERSION_MIN_REQUIRED < 80000
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000
// Supports IOS SDK 8.X (i.e. XCode 6.X and up)
// are we running on IOS8 and above?
if ([[UIApplication sharedApplication] respondsToSelector:@selector(registerForRemoteNotifications)]) {
UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:
UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert
categories:nil];
[[ETPush pushManager] registerUserNotificationSettings:settings];
[[ETPush pushManager] registerForRemoteNotifications];
}
else {
[[ETPush pushManager] registerForRemoteNotificationTypes:UIRemoteNotificationTypeAlert|UIRemoteNotificationTypeBadge|UIRemoteNotificationTypeSound];
}
#else
// Supports IOS SDKs < 8.X (i.e. XCode 5.X or less)
[[ETPush pushManager] registerForRemoteNotificationTypes:UIRemoteNotificationTypeAlert|UIRemoteNotificationTypeBadge|UIRemoteNotificationTypeSound];
#endif
#else
// IPHONEOS_DEPLOYMENT_TARGET >= 8.X
// Supports IOS SDK 8.X (i.e. XCode 6.X and up)
UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:
UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert
categories:nil];
[[ETPush pushManager] registerUserNotificationSettings:settings];
[[ETPush pushManager] registerForRemoteNotifications];
#endif
}
}

1 Answer 1

0

Actually, there is

[[ETPush pushManager] startListeningForApplicationNotifications];

then

[[ETPush pushManager] registerUserNotificationSettings:settings];
[[ETPush pushManager] registerForRemoteNotifications];

so my guess is that he is expecting that the user's Membership status to be : Opted In instead of Not Opted in

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .