How to associate my user_id to the installation_id?

#1

I want to push a notification to a specific user to send him a link to start a tchat, using WonderPush APIs. So I have to identify and associate with installation_id the user (or device) when he is loggin.
How can I do it ?
Thanks

#2

Hi Phil,

You can use the targetInstallationIds parameter of the POST /v1/deliveries call to send a notification to a given installation.

To associate a userId to a device, you must call the setUserId() method of the Android SDK or iOS SDK, or for the Web SDK, give the userId: "foo" initialization option next to webKey in your call to WonderPush.init().
This creates a new installation that is tied to this new user profile.
You can then use the targetUserIds parameter of the POST /v1/deliveries call to send a notification to all installations of the given users.

Reference of POST /v1/deliveries
Reference of the setUserId() method of the Android SDK
Reference of the setUserId() method of the iOS SDK
Reference of the Web SDK initialization options

Best