<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">It works, thank you.<div><br></div><div>Best regards,<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; "><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><div>On Jun 27, 2013, at 5:21 AM, Matthias Wessendorf &lt;<a href="mailto:matzew@apache.org">matzew@apache.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jun 27, 2013 at 7:38 AM, Matthias Wessendorf <span dir="ltr">&lt;<a href="mailto:matzew@apache.org" target="_blank">matzew@apache.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>yes. There is a security branch:</div><div><a href="https://github.com/matzew/aerogear-push-ios-registration/tree/security" target="_blank">https://github.com/matzew/aerogear-push-ios-registration/tree/security</a><br>

</div><div><br></div><div><br></div><div>Please update your Podfile, like this:</div><div>pod 'AeroGearPush', :git =&gt; '<a href="https://github.com/matzew/aerogear-push-ios-registration.git" target="_blank">https://github.com/matzew/aerogear-push-ios-registration.git</a>', :branch =&gt; 'security'<br>
</div></div></blockquote><div><br></div><div><br></div><div style="">and run "pod update" afterwards :-)</div><div>&nbsp;</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div>
</div><div><br></div><div><br></div><div>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):</div><div><br></div>
<div>...<br><span>&nbsp; &nbsp; &nbsp; &nbsp; [clientInfo </span><span>setMobileVariantID</span><span>:</span>@"some_id"<span>];<br></span><span>&nbsp; &nbsp; &nbsp; &nbsp; [clientInfo </span><span>setMobileVariantSecret</span><span>:</span>@"some_secret"<span>];<br>

</span>...</div><div><br></div><div><br></div><div>Greetings,</div><div>Matthias</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div class="h5">On Thu, Jun 27, 2013 at 1:02 AM, Yavuz Selim YILMAZ <span dir="ltr">&lt;<a href="mailto:yavuzsel@buffalo.edu" target="_blank">yavuzsel@buffalo.edu</a>&gt;</span> wrote:<br>

</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div style="word-wrap:break-word">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" target="_blank">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><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px; ">&nbsp;&nbsp; &nbsp;<br></div><div style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(0,132,0)"><span style="">&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><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px; ">&nbsp;&nbsp; &nbsp;<br></div>

<div style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(0,132,0)"><span style="">&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="">&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="">&nbsp; &nbsp; [[</span><span style="color:#4f8187">AGDeviceRegistration</span><span style=""> </span><span style="color:#3d1d81">alloc</span><span style="">] </span><span style="color:#31595d">initWithServerURL</span><span style="">:[</span><span style="color:#703daa">NSURL</span><span style=""> </span><span style="color:#3d1d81">URLWithString</span><span style="">:</span>@"<a href="http://10.193.23.8:8080/pushee/" target="_blank">http://10.193.23.8:8080/pushee/</a>"<span style="">]];</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px; ">&nbsp;&nbsp; &nbsp;<br></div><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><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px; ">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;<br></div><div style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(0,132,0)"><span style="">&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="">&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="">&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="">&nbsp; &nbsp; &nbsp; &nbsp; [clientInfo </span><span style="color:#31595d">setMobileVariantID</span><span style="">:</span>@"MY_VARIANT_ID"<span style="">];</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px; ">

&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;<br></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px; ">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;<br></div><div style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(0,132,0)"><span style="">&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><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px; ">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;<br>

</div><div style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(0,132,0)"><span style="">&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="">&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><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px; ">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;<br></div><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><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px; ">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;<br></div>

<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="">&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="">&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="">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color:#3d1d81">NSLog</span><span style="">(</span>@"PushEE registration Error: %@"<span style="">, 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>
<div style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px">

The registerWithClientInfo call fails with this error:</div><div style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px">

<br></div><div style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing: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" target="_blank">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" target="_blank">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="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px">

<br></div><div style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px">

Do you have any idea/suggestion to solve my problem? Your help is appreciated.</div><div style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px">

<br></div><div style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px">

Thanks and regards,</div><div style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px">

<br>---</div><div style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px">

Yavuz Selim Yilmaz</div><div style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px">

SUNY at Buffalo</div><div style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px">

Computer Science and Engineering</div><div style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px">

PhD Candidate</div>
</div>
<br></div></div><br></div></div>_______________________________________________<br>
aerogear-dev mailing list<br>
<a href="mailto:aerogear-dev@lists.jboss.org" target="_blank">aerogear-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><span class="HOEnZb"><font color="#888888"><br></font></span></blockquote></div><span class="HOEnZb"><font color="#888888"><br>
<br clear="all"><div><br></div>-- <br>Matthias Wessendorf <br>
<br>blog: <a href="http://matthiaswessendorf.wordpress.com/" target="_blank">http://matthiaswessendorf.wordpress.com/</a><br>sessions: <a href="http://www.slideshare.net/mwessendorf" target="_blank">http://www.slideshare.net/mwessendorf</a><br>

twitter: <a href="http://twitter.com/mwessendorf" target="_blank">http://twitter.com/mwessendorf</a>
</font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Matthias Wessendorf <br><br>blog: <a href="http://matthiaswessendorf.wordpress.com/" target="_blank">http://matthiaswessendorf.wordpress.com/</a><br>sessions: <a href="http://www.slideshare.net/mwessendorf" target="_blank">http://www.slideshare.net/mwessendorf</a><br>
twitter: <a href="http://twitter.com/mwessendorf" target="_blank">http://twitter.com/mwessendorf</a>
</div></div>
_______________________________________________<br>aerogear-dev mailing list<br><a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>https://lists.jboss.org/mailman/listinfo/aerogear-dev</blockquote></div><br></div></body></html>