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

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

node.js - Bad Request - node js ajax post -

uitableview - Create and use custom prototype table cells in xamarin ios using storyboard -