Getting Started
Last updated
Last updated
Unity 2018.1
1) Download talkplus-unity.dll
.
2) Add talkplus-unity.dll
to Assets/Plugins folder.
1) Import from TalkPlus namespace.
2) Initialize TalkPlus SDK as follows:
You need to login (either using loginWithAnonymous
or loginWithToken
) once TalkPlus SDK has been initialized.
Once user is logged in, FCM token that was registered stays valid until the user logs out. This lets the user receive push notifications even when offline.
When user logs out, make sure to call logout
function. If this step is omitted and a different user logs into the same device, the latter user will continue to receive push messages intended for the previous user.
TalkPlus subscribes/unsubscribes to realtime channels in sync with app lifecycle.
TalkPlus SDK uses WebSocket to receive messages when your app is in foreground. When you app goes to background, SDK uses FCM to receive messages.
If you intend to receive messages when app goes into background, please refer to Push Notification section on how to set up FCM.
FCM integration is used alongside WebSocket in order to minimize app battery consumption.