[aerogear-dev] AeroGearPush iOS device registration error

Yavuz Selim YILMAZ yavuzsel at buffalo.edu
Wed Jun 26 19:02:02 EDT 2013


Hi all,

After registering an application and iOS variant on my push server following the instructions on https://github.com/aerogear/aerogear-unified-push-server, I am implementing the following method on my iOS client:

// 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 :)
    [[AGDeviceRegistration alloc] initWithServerURL:[NSURL URLWithString:@"http://10.193.23.8:8080/pushee/"]];
    
    [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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/aerogear-dev/attachments/20130626/843919f1/attachment.html 


More information about the aerogear-dev mailing list