[aerogear-dev] AeroGearPush iOS device registration error

Matthias Wessendorf matzew at apache.org
Thu Jun 27 01:38:27 EDT 2013


Hi,

yes. There is a security branch:
https://github.com/matzew/aerogear-push-ios-registration/tree/security


Please update your Podfile, like this:
pod 'AeroGearPush', :git => '
https://github.com/matzew/aerogear-push-ios-registration.git', :branch =>
'security'


When you register the iOS Variant, it gives you a variantID and a secret.
In your iOS, you need to set that (like you are already doing):

...
        [clientInfo setMobileVariantID:@"some_id"];
        [clientInfo setMobileVariantSecret:@"some_secret"];
...


Greetings,
Matthias



On Thu, Jun 27, 2013 at 1:02 AM, Yavuz Selim YILMAZ <yavuzsel at buffalo.edu>wrote:

> 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
>
>
> _______________________________________________
> aerogear-dev mailing list
> aerogear-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/aerogear-dev
>



-- 
Matthias Wessendorf

blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
twitter: http://twitter.com/mwessendorf
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/aerogear-dev/attachments/20130627/19b6e01d/attachment-0001.html 


More information about the aerogear-dev mailing list