Desktop version

Main > Forum > 1C:Enterprise Platform > 1C:Enterprise. Mobile platform > Device Token

Forum

Search UsersRules
Device Token
#1
Active user
Points:: 0
Joined:: Dec 4, 2015

Hello,

I want to use push notifications, but I can't get DeviceToken.

Does anybody know how to get it ?

Profile
#2
Active user
Points:: 0
Joined:: Jun 25, 2013

Hello, Sebastian Dan,

The 1C:Enterprise platform automatically transforms applications from desktop to mobile so 1C developers do not operate with such native mobile concepts like DeviceToken directly.
Why do you need it?

Profile
#3
Active user
Points:: 0
Joined:: Dec 4, 2015

Hello, Sergey Polikarpov,

I want to make a chat and I need to send notifications from server to mobile.

Profile
#4
Active user
Points:: 0
Joined:: Dec 4, 2015

Can you please provide an example how to send notifications to a specific mobile and how to get its ID ?

Thank you!

Profile
#5
Active user
Points:: 0
Joined:: Jun 25, 2013

Sebastian Dan,

Take a look at DeliverableNotificationSubscriberID in Syntax Assistant, the DeviceID property.
To send a notification use the Send method of DeliverableNotificationSendManager

Profile
#6
Active user
Points:: 0
Joined:: Dec 4, 2015

Hello Sergey,

This DeviceID must be generated on each mobile and sent to server. How can I generate it on mobile ?

Profile
#7
Active user
Points:: 0
Joined:: Jun 25, 2013

Sebastian,

To get the device ID, you can use ReceiveNotificationSubscriberID method on a device and pass it to the server. Please remember, that device ID for some reason is not a constant so you have to get and update it time to time. On start, for example.

Profile
#8
Active user
Points:: 0
Joined:: Dec 4, 2015

Hello, Sergey Polikarpov,

I tried to use this function (devID = DeliverableNotifications.ReceiveNotificationSubscriberID();) in ManagedApplicationModule OnStart(), but it generates error "Error calling context method".

I am using 8.3.8.58 on mobile and 8.3.8.2332 on desktop.

Profile
#9
Active user
Points:: 0
Joined:: Jun 25, 2013

Sebastian Dan,

As we discussed there, we need more details to help you. Waiting for your application to look into and debug.

Profile
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)



© 1C LLC. All rights reserved
1C Company respects the privacy of our customers and visitors
to our Web-site.