Yes, I see it now. I'll test it as soon as I can again.

M

Enviado do meu iPhone

No dia 19/03/2014, às 07:47, Erik Jan de Wit <edewit@redhat.com> escreveu:

Yeah didn’t test all possibilities apparently, there is a “ missing on the foreground property. Fixed now.

On 19 Mar,2014, at 0:08 , Miguel Lemos <miguel21op@gmail.com> wrote:

Now: if the app is not in the foreground, but it was not removed (still running), when a notification is sent and I press the status bar, the Safari debugger throws this error: SyntaxError: Unexpected number '0'
and no window is opened.

All I have in my code is:

alert(e.alert);

The string that arrives to the device is like this:

Msg: {"badge":"1","alert":"hlhlkhkl","payload": {"cp":"","cd":"","av":"hlhlkhkl","ul":"","ln":"","en":"598","at":"Aviso","rd":"","lt":"",},"foreground:"0"}


Hope it helps.



On Tue, Mar 18, 2014 at 10:23 PM, Miguel Lemos <miguel21op@gmail.com> wrote:
Not 100% yet.

If the app is running in the foreground, now  the Json array is formed in a different way, and the alert window shows correctly and loads all the paramaters:

2014-03-18 22:00:12.980 SmartDrifter[4011:60b] Msg: {"alert":"Olá! Benvindo aos Armazéns do Chiado","badge":"1","payload": {"lt":"0.00000000000","cd":"","av":"Olá! Benvindo aos Armazéns do Chiado","ul":"http://metal-pr.net/c/?79","ln":"0.00000000000","en":"598","at":"Aviso","cp":"79","rd":"0",},"foreground":"1"}

But if the message arrives first to the status bar (meaning: the app is not available), then nothing happens when I press the notification: the app opens indeed, but no alert window shows. Unfortunately I could not trace any errors, neither through the Safari debugger (the problem happens too soon, maybe before the index.html is fully available), nor through Xcode. But the problem has nothing to do with the previously faulty parameters because an alert(e.alert) doesn't trigger nothing either...



On Tue, Mar 18, 2014 at 9:56 PM, Miguel Lemos <miguel21op@gmail.com> wrote:
Too soon, unfortunately ! 

Isn't yet 100% perfect. There's still a problem if the app is running in the background. I must dig further  to understand why it happens :-(


On Tue, Mar 18, 2014 at 9:50 PM, Sebastien Blanc <scm.blanc@gmail.com> wrote:
Cool !
Would be nice if you could add a comment here https://github.com/aerogear/aerogear-pushplugin-cordova/pull/20 like "+1 it's working" , assuming you have a github account.
 


On Tue, Mar 18, 2014 at 10:46 PM, Miguel Lemos <miguel21op@gmail.com> wrote:
Thanks Seb :-)

I had already notice that and installed the new file "à la main". I't working !


On Tue, Mar 18, 2014 at 9:45 PM, Miguel Lemos <miguel21op@gmail.com> wrote:
Forget my previous post! Done ;-)

I uploaded and installed directly the PushPugin.m to its location. I didn't pay attention to what you wrote...
It's working OK now and there's no error.




On Tue, Mar 18, 2014 at 9:30 PM, Miguel Lemos <miguel21op@gmail.com> wrote:
Erik,

I just uninstalled and installed again the Aerogear plugin, removed and installed again the Ios platform, I compiled the program, but the result didn't change:


XCode debugger:


2014-03-18 21:24:11.983 SmartDrifter[3892:60b] Msg: {en:'598',cd:'',badge:'1',alert:'Teste',av:'Teste',ul:'',ln:'',at:'Aviso',cp:'',rd:'',lt:'',foreground:'1',}

cordova plugin add org.jboss.aerogear.cordova.push

Maybe you didn't uploaded it yet?

Thanks

M



On Tue, Mar 18, 2014 at 4:41 PM, Miguel Lemos <miguel21op@gmail.com> wrote:
Yes. That "trick" has to be used sometimes. That's a very annoying Cordova issue. Thanks.

Enviado do meu iPhone

No dia 18/03/2014, às 16:37, Sebastien Blanc <scm.blanc@gmail.com> escreveu:




On Tue, Mar 18, 2014 at 5:34 PM, Miguel Lemos <miguel21op@gmail.com> wrote:
Thanks Erik. I know that; the total payload never surpasses 256 byes and the av parameter (the notification itself) 107 characters.

After the correction I just have the reinstall the plugin?
That should be enough but it has sometime failed for me , in this case you will need to do a : 

cordova platform remove ios  
cordova platform add ios


M

Enviado do meu iPhone

No dia 18/03/2014, às 16:24, Erik Jan de Wit <edewit@redhat.com> escreveu:

BTW Miguel I see that you are sending a lot of extras in the message, be careful that Apple doesn’t allow the message to become to big the max is 256 bytes. 

On 18 Mar,2014, at 17:08 , Erik Jan de Wit <edewit@redhat.com> wrote:



On 18 Mar,2014, at 15:49 , Miguel Lemos <miguel21op@gmail.com> wrote:

Fine, Erik!

Nice to know it's easy to fix.

A small issue, that caused - almost - everything to fail...

I'm glad I could help in the role of "bug buster" ;-)

Miguel

Enviado do meu iPhone

_______________________________________________
aerogear-dev mailing list
aerogear-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/aerogear-dev

_______________________________________________
aerogear-dev mailing list
aerogear-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/aerogear-dev

_______________________________________________
aerogear-dev mailing list
aerogear-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/aerogear-dev

_______________________________________________
aerogear-dev mailing list
aerogear-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/aerogear-dev




_______________________________________________
aerogear-dev mailing list
aerogear-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/aerogear-dev


_______________________________________________
aerogear-dev mailing list
aerogear-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/aerogear-dev



_______________________________________________
aerogear-dev mailing list
aerogear-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/aerogear-dev

_______________________________________________
aerogear-dev mailing list
aerogear-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/aerogear-dev