Difference between revisions of "NotificationManager:registerForPushNotifications"

From GiderosMobile
(Created page with "__NOTOC__ '''Available since:''' Gideros 2011.6<br/> === Description === Register device for receiveng push notifications. On Android this method accepts the string value of...")
 
Line 16: Line 16:
 
Although this method can be called multiple times, and even if already registered it will still return same device token with the event object, but it is still recommended to persistant store device token if you'll be needing it later.
 
Although this method can be called multiple times, and even if already registered it will still return same device token with the event object, but it is still recommended to persistant store device token if you'll be needing it later.
 
<source lang="lua">
 
<source lang="lua">
= NotificationManager:registerForPushNotifications()
+
NotificationManager:registerForPushNotifications()
 
</source>
 
</source>

Revision as of 10:20, 23 August 2018

Available since: Gideros 2011.6

Description

Register device for receiveng push notifications.

On Android this method accepts the string value of project ID in Google API console.

On IOS this method does not require any input, but for compatability purpose, you may pass same string as for Android or any other string, as it won't do any harm.

Before calling this method you should register for two events:

for successful registration
for registration error

Upon successful registration you will receive the device token with the event object, that you should pass to your server, which will be sending push notifications.

Although this method can be called multiple times, and even if already registered it will still return same device token with the event object, but it is still recommended to persistant store device token if you'll be needing it later.

 NotificationManager:registerForPushNotifications()