ios6 - Get device token if user refuse Push notification ios -
i have set push notification new app. have heard not way device token using:
- (void)application:(uiapplication *)application didregisterforremotenotificationswithdevicetoken:(nsdata *)newdevicetoken { nsstring *devicetoken = [[newdevicetoken description] stringbytrimmingcharactersinset:[nscharacterset charactersetwithcharactersinstring:@"<>"]]; devicetoken = [devicetoken stringbyreplacingoccurrencesofstring:@" " withstring:@""]; nslog(@"###### device token = %@ #########",devicetoken); } everything okay me, nevertheless use token log in user base, have problem: how can device token if user refuses receive push notifications? how can device token outside app delegate?
you cannot device token if user not agree receive push notifications. method
- (void)application:(uiapplication *)application didfailtoregisterforremotenotificationswitherror:(nserror *)error will called instead cannot token that.
if you're looking unique identifer, should consider using identifierforvendor. see documentation here: http://developer.apple.com/library/ios/#documentation/uikit/reference/uidevice_class/reference/uidevice.html#//apple_ref/occ/instp/uidevice/identifierforvendor
Comments
Post a Comment