How to Test the Soft Ask Push Permissions Opt-in Message

If you simply want to test the appearance of a custom Soft Ask Push Permissions template, then the easiest way to test this, without altering the code of the custom Soft Ask Push Permissions is to preview the message on a registered developer’s device.

If there are multiple registered developer’s devices, as well as multiple builds, then it may make sense for the templates of the custom ask to ask to be altered to properly QA the Soft Ask Push Permissions. The reason being that if your team has multiple registered developer’s device, then the preview will go to all registered developer devices.

Normally, with Soft Ask Push Permissions, the code under withResponder, calls for the registration (or opt out) of the device for push notifications. Currently, we recommend that you alter the Soft Ask Push Permissions for QA purposes to display as a center pop up. Within the custom templates, under withResponder:^BOOL(LPActionContext *context){, copy the following code:

[Leanplum onceVariablesChangedAndNoDownloadsPending:^{ @try {

   [self closePopup:NO withAcceptAction:NO]; [self­>_contexts addObject:context];
   [self showPopup];

}
@catch (NSException *exception) {

   LOG_LP_MESSAGE_EXCEPTION; }

}];

return YES; }];

Then, make the code modifications to ensure that the Soft Ask Push Permissions renders properly within the app. Using this method, you can target to a specific device without disrupting other developers.

*Note: Make sure that once you are ready to push this specific campaign to production that you replace withResponder with the correct code to obtain the push tokens for the devices.

The Importance of Resetting Your Device’s Push Settings

When testing Soft Ask Push Permissions for appearance and functionality, it is important to reset your device’s push notification settings after each time you opt in or out of they system level prompt. There are two options: resetting the push settings and resetting the device. The former is simpler and therefore preferable.

Resetting Push Settings

  1. Delete your app from the device.
  2. Turn the device off completely and turn it back on.
  3. Navigate to Settings > General > Date & Time and set the date ahead a day or more.
  4. Turn the device off completely again and turn it back on.
  5. Re­install your app, open it and test the Soft Ask Push Permissions.

The push settings are now reset on the phone for the app, and you will be able to run the app and get prompted for the Soft Ask Push Permissions as intended in the app.

Resetting the Device

  1. Go to Settings > General ­> Reset ­> Reset all Contents and Settings (the device will now effectively be restored to factory settings).
  2. Re­install your app, open it and test the ask to ask.

iOS will treat this as a new device and will therefore display the Soft Ask Push Permissions


Was this article helpful?
Have more questions? Submit a request