// Here we need to register this "Mobile Variant Instance"
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
// we init our "Registration helper:
AGDeviceRegistration *registration =
// WARNING: make sure, you start JBoss with the -b 0.0.0.0 option, to bind on all interfaces
// from the iPhone, you can NOT use localhost :)
[registration registerWithClientInfo:^(id<AGClientDeviceInformation> clientInfo) {
// Use the Mobile Variant ID, from your register iOS Variant
//
// This ID was received when performing the HTTP-based registration
// with the PushEE server:
[clientInfo setMobileVariantID:@"MY_VARIANT_ID"];
// apply the token, to identify THIS device
[clientInfo setDeviceToken:deviceToken];
// --optional config--
// set some 'useful' hardware information params
UIDevice *currentDevice = [UIDevice currentDevice];
[clientInfo setOperatingSystem:[currentDevice systemName]];
[clientInfo setOsVersion:[currentDevice systemVersion]];
[clientInfo setDeviceType: [currentDevice model]];
} success:^() {
//
} failure:^(NSError *error) {
// did receive an HTTP error from the PushEE server ???
// Let's log it for now:
NSLog(@"PushEE registration Error: %@", error);
}];
}
The registerWithClientInfo call fails with this error:
PushEE registration Error: Error Domain=AFNetworkingErrorDomain Code=-1011 "Expected status code in (200-299), got 401" UserInfo=0x1d5522b0 {NSLocalizedRecoverySuggestion=Unauthorized Request, AFNetworkingOperationFailingURLRequestErrorKey=<NSMutableURLRequest
http://10.193.23.8:8080/pushee/rest/registry/device>, NSErrorFailingURLKey=
http://10.193.23.8:8080/pushee/rest/registry/device, NSLocalizedDescription=Expected status code in (200-299), got 401, AFNetworkingOperationFailingURLResponseErrorKey=<NSHTTPURLResponse: 0x1d549310>}
Do you have any idea/suggestion to solve my problem? Your help is appreciated.
Thanks and regards,
---
Yavuz Selim Yilmaz
SUNY at Buffalo
Computer Science and Engineering
PhD Candidate