Sunday 15 February 2015

ios - APNS Push Notification - device token and keychain -



ios - APNS Push Notification - device token and keychain -

to knowledge, 1 time got device token apns, can't again. (except backup info new device or computer, or reinstalls operating scheme or time device token changes phone call didregisterforremotenotificationswithdevicetoken)

so,

any time device token changes , replace , save new device token in keychain avoid disappears other purposes (likes utilize device token uuid).

is possible when keychain info disappeared, device token not changes?

( if yes. lead didregisterforremotenotificationswithdevicetoken not called again,and can't retrieve lastly device token. )

or events allow keychain info disappeared also(generally) allow device token changed (or trigger didregisterforremotenotificationswithdevicetoken 1 time again ) ?

in test,

a. "reset settings" in iphone not clear keychain info , trigger didregisterforremotenotificationswithdevicetoken.

b. "erase content , settings" in iphone clear keychain info , remove apps. when re-install app phone call didregisterforremotenotificationswithdevicetoken again.

case , b not bother me, , think updating os version, reinstalling os or event allow device token changed also.

anyone knows right corresponding state of value alter between keychain , device token ?

thanks!!

update

the question event lets keychain info disappeared also(generally) triggers "didregisterforremotenotificationswithdevicetoken" againg or not?

if not, event?

"to knowledge, 1 time got device token apns, can't again"

when app loads, call

[[uiapplication sharedapplication] registerforremotenotifications];

this leads app delegate method:

- (void) application:(uiapplication *)app didregisterforremotenotificationswithdevicetoken:(nsdata *)token

being called. token handed each time app runs. shouldn't need store in keychain.

you of course of study need send token value back-end can used originate force messages.

ios objective-c apple-push-notifications keychain devicetoken

No comments:

Post a Comment