<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi all,<div><br></div><div>After registering an application and iOS variant on my push server following the instructions on&nbsp;<a href="https://github.com/aerogear/aerogear-unified-push-server">https://github.com/aerogear/aerogear-unified-push-server</a>, I am implementing the following method on my iOS client:</div><div><br></div><div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0); ">// Here we need to register this "Mobile Variant Instance"</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">- (<span style="color: #bb2ca2">void</span>)application:(<span style="color: #703daa">UIApplication</span> *)application didRegisterForRemoteNotificationsWithDeviceToken:(<span style="color: #703daa">NSData</span> *)deviceToken {</div><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px; ">&nbsp;&nbsp; &nbsp;<br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0); "><span style="color: #000000">&nbsp; &nbsp; </span>// we init our "Registration helper:</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">&nbsp; &nbsp; <span style="color: #4f8187">AGDeviceRegistration</span> *registration =</div><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px; ">&nbsp;&nbsp; &nbsp;<br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0); "><span style="color: #000000">&nbsp; &nbsp; </span>// WARNING: make sure, you start JBoss with the -b 0.0.0.0 option, to bind on all interfaces</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0); "><span style="color: #000000">&nbsp; &nbsp; </span>// from the iPhone, you can NOT use localhost :)</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(209, 47, 27); "><span style="color: #000000">&nbsp; &nbsp; [[</span><span style="color: #4f8187">AGDeviceRegistration</span><span style="color: #000000"> </span><span style="color: #3d1d81">alloc</span><span style="color: #000000">] </span><span style="color: #31595d">initWithServerURL</span><span style="color: #000000">:[</span><span style="color: #703daa">NSURL</span><span style="color: #000000"> </span><span style="color: #3d1d81">URLWithString</span><span style="color: #000000">:</span>@"<a href="http://10.193.23.8:8080/pushee/">http://10.193.23.8:8080/pushee/</a>"<span style="color: #000000">]];</span></div><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px; ">&nbsp;&nbsp; &nbsp;<br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">&nbsp; &nbsp; [registration <span style="color: #31595d">registerWithClientInfo</span>:^(<span style="color: #bb2ca2">id</span>&lt;<span style="color: #4f8187">AGClientDeviceInformation</span>&gt; clientInfo) {</div><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px; ">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;<br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0); "><span style="color: #000000">&nbsp; &nbsp; &nbsp; &nbsp; </span>// Use the Mobile Variant ID, from your register iOS Variant</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008400">//</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0); "><span style="color: #000000">&nbsp; &nbsp; &nbsp; &nbsp; </span>// This ID was received when performing the HTTP-based registration</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0); "><span style="color: #000000">&nbsp; &nbsp; &nbsp; &nbsp; </span>// with the PushEE server:</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(209, 47, 27); "><span style="color: #000000">&nbsp; &nbsp; &nbsp; &nbsp; [clientInfo </span><span style="color: #31595d">setMobileVariantID</span><span style="color: #000000">:</span>@"MY_VARIANT_ID"<span style="color: #000000">];</span></div><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px; ">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;<br class="webkit-block-placeholder"></p><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px; ">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;<br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0); "><span style="color: #000000">&nbsp; &nbsp; &nbsp; &nbsp; </span>// apply the token, to identify THIS device</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">&nbsp; &nbsp; &nbsp; &nbsp; [clientInfo <span style="color: #31595d">setDeviceToken</span>:deviceToken];</div><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px; ">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;<br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0); "><span style="color: #000000">&nbsp; &nbsp; &nbsp; &nbsp; </span>// --optional config--</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0); "><span style="color: #000000">&nbsp; &nbsp; &nbsp; &nbsp; </span>// set some 'useful' hardware information params</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #703daa">UIDevice</span> *currentDevice = [<span style="color: #703daa">UIDevice</span> <span style="color: #3d1d81">currentDevice</span>];</div><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px; ">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;<br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">&nbsp; &nbsp; &nbsp; &nbsp; [clientInfo <span style="color: #31595d">setOperatingSystem</span>:[currentDevice <span style="color: #3d1d81">systemName</span>]];</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">&nbsp; &nbsp; &nbsp; &nbsp; [clientInfo <span style="color: #31595d">setOsVersion</span>:[currentDevice <span style="color: #3d1d81">systemVersion</span>]];</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">&nbsp; &nbsp; &nbsp; &nbsp; [clientInfo <span style="color: #31595d">setDeviceType</span>: [currentDevice <span style="color: #3d1d81">model</span>]];</div><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px; ">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;<br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">&nbsp; &nbsp; } <span style="color: #31595d">success</span>:^() {</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008400">//</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">&nbsp; &nbsp; } <span style="color: #31595d">failure</span>:^(<span style="color: #703daa">NSError</span> *error) {</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0); "><span style="color: #000000">&nbsp; &nbsp; &nbsp; &nbsp; </span>// did receive an HTTP error from the PushEE server ???</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0); "><span style="color: #000000">&nbsp; &nbsp; &nbsp; &nbsp; </span>// Let's log it for now:</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(209, 47, 27); "><span style="color: #000000">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #3d1d81">NSLog</span><span style="color: #000000">(</span>@"PushEE registration Error: %@"<span style="color: #000000">, error);</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">&nbsp; &nbsp; }];</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">}</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; "><br></div><div apple-content-edited="true">
<div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">The registerWithClientInfo call fails with this error:</div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><br></div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">PushEE registration Error: Error Domain=AFNetworkingErrorDomain Code=-1011 "Expected status code in (200-299), got 401" UserInfo=0x1d5522b0 {NSLocalizedRecoverySuggestion=Unauthorized Request, AFNetworkingOperationFailingURLRequestErrorKey=&lt;NSMutableURLRequest <a href="http://10.193.23.8:8080/pushee/rest/registry/device">http://10.193.23.8:8080/pushee/rest/registry/device</a>&gt;, NSErrorFailingURLKey=<a href="http://10.193.23.8:8080/pushee/rest/registry/device">http://10.193.23.8:8080/pushee/rest/registry/device</a>, NSLocalizedDescription=Expected status code in (200-299), got 401, AFNetworkingOperationFailingURLResponseErrorKey=&lt;NSHTTPURLResponse: 0x1d549310&gt;}</div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><br></div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">Do you have any idea/suggestion to solve my problem? Your help is appreciated.</div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><br></div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">Thanks and regards,</div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><br class="Apple-interchange-newline">---</div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">Yavuz Selim Yilmaz</div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">SUNY at Buffalo</div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">Computer Science and Engineering</div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">PhD Candidate</div>
</div>
<br></div></body></html>