mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
Correctly setting apns token.
This commit is contained in:
parent
06ab218ac9
commit
d228ecb0e8
2 changed files with 6 additions and 4 deletions
|
@ -3,7 +3,7 @@ from django.conf import settings
|
|||
from django.contrib.auth.decorators import login_required
|
||||
from utils import json_functions as json
|
||||
from utils.user_functions import get_user, ajax_login_required
|
||||
from apps.notifications.models import MUserFeedNotification
|
||||
from apps.notifications.models import MUserFeedNotification, MUserNotificationTokens
|
||||
|
||||
|
||||
@ajax_login_required
|
||||
|
|
|
@ -364,13 +364,15 @@
|
|||
}
|
||||
|
||||
NSLog(@" -> APNS token: %@", token);
|
||||
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@/notifications/set_apns_token/",
|
||||
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@/notifications/apns_token/",
|
||||
self.url]];
|
||||
ASIHTTPRequest *_request = [ASIHTTPRequest requestWithURL:url];
|
||||
__weak ASIHTTPRequest *request = _request;
|
||||
ASIFormDataRequest *_request = [ASIFormDataRequest requestWithURL:url];
|
||||
__weak ASIFormDataRequest *request = _request;
|
||||
[request setValidatesSecureCertificate:NO];
|
||||
[request setResponseEncoding:NSUTF8StringEncoding];
|
||||
[request setDefaultResponseEncoding:NSUTF8StringEncoding];
|
||||
[request setPostValue:token
|
||||
forKey:@"apns_token"];
|
||||
[request setFailedBlock:^(void) {
|
||||
NSLog(@"Failed to set APNS token");
|
||||
}];
|
||||
|
|
Loading…
Add table
Reference in a new issue