django - iOS Push Notifications is not received -
backend - django
frontend - objective c (x-code)
i've followed this apple document configure push notifications , completed steps.
for backend, using django-push-notifications django==1.7 , results no error when message sent.
for frontend, have added following lines receive notification,
uiusernotificationtype usernotificationtypes = (uiusernotificationtypealert | uiusernotificationtypebadge | uiusernotificationtypesound); uiusernotificationsettings *settings = [uiusernotificationsettings settingsfortypes:usernotificationtypes categories:nil]; [application registerusernotificationsettings:settings]; [application registerforremotenotifications]; - (void)application:(uiapplication *)application didregisterforremotenotificationswithdevicetoken:(nsdata *)devicetoken { nsstring *token = [[devicetoken description] stringbytrimmingcharactersinset: [nscharacterset charactersetwithcharactersinstring:@"<>"]]; token = [token stringbyreplacingoccurrencesofstring:@" " withstring:@""]; nslog(@"content---%@", token); uialertview *alert = [[uialertview alloc] initwithtitle:@"devicetoken!!!" message:token delegate:self cancelbuttontitle:@"cancel" otherbuttontitles:nil]; [alert show]; } - (void)application:(uiapplication *)application didreceiveremotenotification:(nsdictionary *)userinfo { .... }
but after this, not able receive notification. have completed , configured steps correctly? x-code version 6.3 , apple device ios version on 8.4. should both compatible versions receive notifications?
is there way log or view progress @ apns cloud?
use devicetoken directly like
- (void)application:(uiapplication*)application didregisterforremotenotificationswithdevicetoken:(nsdata*)devicetoken { nslog(@"my token is: %@", devicetoken); }
also need sure you're sending push-notification.
try use this tutorial , application sure you're sending push correctly , need fix frontend.
Comments
Post a Comment