BPAPI Methods

BPAPI method Notification/AddApp

Notification/AddApp

Adds an identification for sending notifications to a Smartphone App

Authorization required: Yes

HTTP methods allowed: GET, POST

Syntax: Notification/AddApp/{app_name}/{id}/  Details   Details   Details 

Adds an identification for sending notifications to a Smartphone App

Supports the following types of notifications:
1) An Android GCM (Google Cloud Messaging) RegistrationId. See http://developer.android.com/google/gcm/index.html for more information. Or
2) An APNS (Apple Push Notification Service) DeviceToken. See https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/ApplePushService.html for more information


If the {id} (RegistrationId / DeviceToken) already exist then the actual property's last_valid field will be updated (together with {app_name}).
If the {id} do not exist then the method is equivalent to
Customer/AddProperty/notification_recipient_app_X/{id}/
where X should be the first "non-occupied" index found (except that less syntax-checking will be done). (see Customer/AddProperty)

Tip: Add a slash, /, to the end of your query string if the last parameter contains a full stop . or dash - and you want to use HTTP method GET.

Note that a Smartphone App is expected to regularly confirm an id (RegistrationId / DeviceToken). Old ids may be purged regularly from BPAPI. Ids may also be purged if they are confirmed invalid by the relevant service (Google Cloud Messaging / Apple Push Notification Service)

Note that a given {id} can only exist for one customer at a time in the database. Duplicates will be set no-longer-current. The rationale behind this is to ensure that a given smartphone only receives notifications for the latest customer which the user has logged in as.
(for instance, an installator would not want to continue to receive notifications for all old customers' systems that he has ever tested with his smartphone)


Unit-tests: 3 test(s)

Popularity: 3982460 (number of times method has been accessed)

Documentation and tests automatically generated from source-code 2020-04-08 16:17