<meta http-equiv="content-type" content="text/html; charset=utf-8"><div>Good point. &nbsp;I hate having to do device checks.&nbsp;</div><div><br>On Mar 13, 2014, at 2:46 AM, "Erik Jan de Wit [via aerogear-dev]" &lt;<a href="/user/SendEmail.jtp?type=node&node=6772&i=0" target="_top" rel="nofollow" link="external">[hidden email]</a>&gt; wrote:<br><br></div><blockquote style='border-left:2px solid #CCCCCC;padding:0 1em' type="cite"><div>

        <meta http-equiv="Content-Type" content="text/html charset=windows-1252"><div>Hi,</div><div><br></div><div>Currently the plugin supports only one set of varaintId and secret and if you want to create an application for android and iOS you would have logic like</div><div><pre style="box-sizing: border-box; margin-top: 15px; margin-bottom: 15px; background-color: rgb(248, 248, 248); border: 1px solid rgb(221, 221, 221); overflow: auto; padding: 6px 10px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: normal;"><div style="color: rgb(0, 0, 0); font-size: 12px; line-height: normal; white-space: normal;"><font face="Courier">if (device.platform == ‘android’) {</font></div><div style="color: rgb(0, 0, 0); font-size: 12px; line-height: normal; white-space: normal;"><font face="Courier">&nbsp; &nbsp;variantId =&nbsp;</font><span style="color: rgb(221, 17, 68); font-family: Consolas, 'Liberation Mono', Courier, monospace; line-height: 16px; white-space: pre; background-color: rgb(255, 255, 255);">"&lt;variantID for android&gt;"</span><font face="Courier">;</font></div><div style="color: rgb(0, 0, 0); font-size: 12px; line-height: normal; white-space: normal;"><font face="Courier">} else {</font></div><div><font face="Courier" style="color: rgb(0, 0, 0); font-size: 12px; line-height: normal; white-space: normal;">&nbsp; &nbsp;variantId =&nbsp;</font><span style="background-color: rgb(255, 255, 255);"><font color="#dd1144" face="Consolas, Liberation Mono, Courier, monospace"><span style="line-height: 16px;">"&lt;variantID for iOS&gt;"</span></font></span><font face="Courier" style="color: rgb(0, 0, 0); font-size: 12px; line-height: normal; white-space: normal;">;</font></div><div style="color: rgb(0, 0, 0); font-size: 12px; line-height: normal; white-space: normal;"><font face="Courier">}</font></div></pre></div><div>so with this grouping you don’t have to have this if else logic anymore as you can just add them in the config like so:</div><div><pre style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 13px; margin-top: 15px; margin-bottom: 15px; background-color: rgb(248, 248, 248); border: 1px solid rgb(221, 221, 221); line-height: 19px; overflow: auto; padding: 6px 10px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: normal; color: rgb(51, 51, 51);"><pre style="color: rgb(0, 0, 0); font-size: 12px; font-family: Consolas, 'Liberation Mono', Courier, monospace; line-height: 16.799999237060547px; width: 744px; margin-top: 0px; margin-bottom: 0px; padding: 0px; background-color: rgb(255, 255, 255); position: static; z-index: auto;"><div><div><span style="color: rgb(51, 51, 51); font-size: 13px; line-height: 19px; font-weight: bold;">var</span><span style="background-color: rgb(248, 248, 248); color: rgb(51, 51, 51); font-size: 13px; line-height: 19px;"> </span><span style="color: rgb(51, 51, 51); font-size: 13px; line-height: 19px;">pushConfig</span><span style="background-color: rgb(248, 248, 248); color: rgb(51, 51, 51); font-size: 13px; line-height: 19px;"> </span><span style="color: rgb(51, 51, 51); font-size: 13px; line-height: 19px; font-weight: bold;">= </span><span style="line-height: 16.799999237060547px;">{</span></div>
<div class="">    pushServerURL<span style="font-weight: bold;">:</span> <span style="color: rgb(221, 17, 68);">"&lt;pushServerURL e.g http(s)//host:port/context &gt;"</span>,</div></div><div class=""><div>
    alias<span style="font-weight: bold;">:</span> <span style="color: rgb(221, 17, 68);">"&lt;alias e.g. a username or an email address optional&gt;"</span>,</div><div>    android<span style="font-weight: bold;">:</span> {</div>
<div>      senderID<span style="font-weight: bold;">:</span> <span style="color: rgb(221, 17, 68);">"&lt;senderID e.g Google Project ID only for android&gt;"</span>,</div><div><div>      variantID<span style="font-weight: bold;">:</span> <span style="color: rgb(221, 17, 68);">"&lt;variantID e.g. 1234456-234320&gt;"</span>,</div>
<div>      variantSecret<span style="font-weight: bold;">:</span> <span style="color: rgb(221, 17, 68);">"&lt;variantSecret e.g. 1234456-234320&gt;"</span></div></div><div>    },</div></div><div class=""><div>    ios<span style="font-weight: bold;">:</span> {</div>
<div><div>      variantID<span style="font-weight: bold;">:</span> <span style="color: rgb(221, 17, 68);">"&lt;variantID e.g. 1234456-234320&gt;"</span>,</div><div>      variantSecret<span style="font-weight: bold;">:</span> <span style="color: rgb(221, 17, 68);">"&lt;variantSecret e.g. 1234456-234320&gt;"</span></div>
<div>    }</div></div></div><div>};</div></pre></pre></div><div>And when a windows phone is added you’ll still have to change the code to add the variantId for windows. As we don’t have a way to register for the application only for the variant this is the compromise.</div><div><span class="p" style="box-sizing: border-box;"><br></span></div><div><span class="p" style="box-sizing: border-box;">Cheers,</span></div><div><span class="p" style="box-sizing: border-box;"><span class="Apple-tab-span" style="white-space:pre">        </span>Erik Jan</span></div><br><br>_______________________________________________
<br>aerogear-dev mailing list
<br><a href="/user/SendEmail.jtp?type=node&amp;node=6769&amp;i=0" target="_top" rel="nofollow" link="external">[hidden email]</a>
<br><a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_top" rel="nofollow" link="external">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a>

        
        
        
        <br>
        <br>
        <hr noshade="noshade" size="1" color="#cccccc">
        <div style="color:#444; font: 12px tahoma,geneva,helvetica,arial,sans-serif;">
                <div style="font-weight:bold">If you reply to this email, your message will be added to the discussion below:</div>
                <a href="http://aerogear-dev.1069024.n5.nabble.com/aerogear-dev-cordova-push-plugin-simplification-tp6523p6769.html" target="_top" rel="nofollow" link="external">http://aerogear-dev.1069024.n5.nabble.com/aerogear-dev-cordova-push-plugin-simplification-tp6523p6769.html</a>
        </div>
        <div style="color:#666; font: 11px tahoma,geneva,helvetica,arial,sans-serif;margin-top:.4em;line-height:1.5em">
                
                To unsubscribe from [aerogear-dev] cordova push plugin simplification, <a href="" target="_top" rel="nofollow" link="external">click here</a>.<br>
                <a href="http://aerogear-dev.1069024.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&amp;id=instant_html%21nabble%3Aemail.naml&amp;base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&amp;breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml" rel="nofollow" style="font:9px serif" target="_top" link="external">NAML</a>
        </div></div></blockquote>

        
        
        
<br/><hr align="left" width="300" />
View this message in context: <a href="http://aerogear-dev.1069024.n5.nabble.com/aerogear-dev-cordova-push-plugin-simplification-tp6523p6772.html">Re: [aerogear-dev] cordova push plugin simplification</a><br/>
Sent from the <a href="http://aerogear-dev.1069024.n5.nabble.com/">aerogear-dev mailing list archive</a> at Nabble.com.<br/>