Objective is to implement push subscription by using Xtify SDK in iOS and Android apps. The other requirement is that subscription should happen to Xtify only if user has done successful login and users agreement to subscription (not before that). But the problem is that in Xtify SDK I don't find any explicit subscription method and it appears that subscription happens automatically at the time when app gets loaded for the first time. I want to control this behavior and want to call subscription only after successful login and users acceptance (via js popup) that he wants to register (or not) to Xtify notifications. Based on his response, I'll decide whether to subscribe to Xtify or not.
Requirement is XID should not be generated till the time login is successful and user has accepted some terms & condition after that.
Please let me know SDK subscription method where I can decide when to call.
App details:
- IBM Worklight 6.2 Hybrid app
- Environments: Android and iOS
For iOS, you will need to move Xtify initialization code to the login section. In particular move the following code to the desire place:
For Android, you'll need to move initialization, see below, from MainActivity::onStart() to the desire place: