Total Pageviews

Monday, May 26, 2014

Event Notification

Event Notification
វាមាន properties ដូចខាងក្រោម

event.type
វាជាString ដែលកំនត់នៅប្រភេទ notification event វាអាចជា
Local​សំរាប់ event បានបង្កើតឡើងលើ locally
Remote សំរាប់ remote push events ដែលចេញពី Server
remoteRegystration សំរាប់ការចាប់ផ្តើមនៅ remote push events បើសិនជាសំរេចពេលនោះ event ផ្ទុកនៅ token property  ដែលផ្ទុកនៅ string needed  ដោយ push server ក្នុងការ communicate with Apple’s push Notification server បើមិនទេវានឹងបង្ហាញថាerror

សូមមើលកូដះ
local launchArgs = ...

if launchArgs and launchArgs.notification then
    --[[ if the application got launched as a result of the user viewing a notification, the notification table contains:
    launchArgs.notification.type - "remote"
    launchArgs.notification.name - "notification"
    launchArgs.notification.sound - "sound file or 'default'"
    launchArgs.notification.alert - "message specified during push"
    launchArgs.notification.badge - "5" -- badge value that was sent
    launchArgs.notification.applicationstate - "inactive"
    --]]
end

event.name វាជា​String notification
សូមមើលកូដ
local launchArgs = ...
if launchArgs and launchArgs.notification then
    --[[ if the application got launched as a result of the user viewing a notification, the notification table contains:
    launchArgs.notification.type - "remote"
    launchArgs.notification.name - "notification"
    launchArgs.notification.sound - "sound file or 'default'"
    launchArgs.notification.alert - "message specified during push"
    launchArgs.notification.badge - "5" -- badge value that was sent
    launchArgs.notification.applicationstate - "inactive"
    --]]
end

event.applicationState វាជា String ដែលបង្ហាញនៅ state application នៅពេលដែល notification ត្រូវបានទទួល
active indicates that the app was currently running at the time
inactive indicates that the app was suspended or closed at the time
សូមមើលកូដះ
local launchArgs = ...

if launchArgs and launchArgs.notification then
    --[[ if the application got launched as a result of the user viewing a notification, the notification table contains:

    launchArgs.notification.type - "remote"
    launchArgs.notification.name - "notification"
    launchArgs.notification.sound - "sound file or 'default'"
    launchArgs.notification.alert - "message specified during push"
    launchArgs.notification.badge - "5" -- badge value that was sent
    launchArgs.notification.applicationstate - "inactive"

    --]]
end

event.custom​ វាជាតារាងដែលផ្តល់នៅពេលដែល notificationwas scheduled or pushed
តារាងនឹងប្រែទៅជា​  ទទេបើសិនជា custom data ត្រូវបានផ្តលើឪ្យ





No comments:

Post a Comment