Detecting a changed SIM card

When a user changes a SIM card in a BlackBerry device, the BlackBerry 10 WebWorks SDK automatically destroys the channel to the PPG for security purposes. A new user might be using the device, and that user shouldn't receive push messages that were intended for the previous user. Your app should authenticate all new users and create a new channel to the PPG.

The sample app passes in the onSimChange() callback function as part of the call to PushService.create(), which creates the PushService object.

blackberry.push.PushService.create(ops, 
  sample.pushcapture.successCreatePushService, 
  sample.pushcapture.failCreatePushService, 
  sample.pushcapture.onSimChange,
  sample.pushcapture.onPushTransportReady);
The onSimChange() callback function performs the following actions when a user changes a SIM card in a device:
  • Removes the user and all the push messages associated with the user from the database.
  • Removes notifications in the BlackBerry Hub that are associated with the user.
  • Unsubscribes the user from the server-side push initiator, if the user chose to subscribe with the Push Service SDK.
  • Displays a message indicating that the SIM card has changed.
  • Displays the Register screen so that a new user, or the same user with a new SIM card, can register.

Last modified: 2015-06-11



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus