Hi,

the client side spec describes the required functionality to register devices with the Unified Push Server.

The client SKD should be simple to use. For the iOS, I thought about a register that takes three blocks:

// AppDelegate code/delegate function, for a push enabled application:
- (void)application:(UIApplication *)application 
   // deviceToken provided by APNs
   didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { 

  // the AG AGDeviceRegistration helper/class:
  [registration registerWithClientInfo:^(id<AGClientDeviceInformation> clientInfo) {
    // apply the desired info:
    clientInfo.token = deviceToken;
    clientInfo.alias = @"mister@xyz.com";
    clientInfo.mobileVariantID = @"123456432134564321345432";
    // ... as needed more of the data;
  } success:^(id responseObject) {
     // invoked, on 200 HTTP response code from the Unified Push Server
  } failure:^(NSError *error) {
    // invoked:
      // missing required data (e.g. no token submitted)
      // on 4xx/5zz HTTP response codes from the Unified Push Server
}];
}

The above registerWithClientInfo:successfailure method uses AFNetworking to submit the receiveddeviceToken to the AeroGear Unified Push Server. The desired information data is provided on the first callback.

The concept of a "block" for setting up data/objects has been useful on AGPipeConfig, so reusing the concept here as well.

Note: Class/method names may change over time...

Thoughts ?



-Matthias


--
Matthias Wessendorf

blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
twitter: http://twitter.com/mwessendorf