Re: [b2g] Can't use mozAlarms API

2014-04-14 Thread nsm . nikhil
On Thursday, April 10, 2014 4:52:55 PM UTC-7, Prateek Jadhwani wrote:
 Hi there,
 
 I am trying to use the example given in 
 
 https://developer.mozilla.org/en-US/docs/Web/API/MozAlarmsManager.getAll 
 
 for one of my bugs, and it seems that it returns a different id everytime I 
 try to get alarm.id  and returns the current time in alarm.date.toString().

Could you paste example code of what your script is doing. If you are using the 
result of add(), it will be a new ID every time.
 
 Also, this link https://wiki.mozilla.org/WebAPI/AlarmAPI says No, the 
 getAll(...) only returns the alarms scheduled by the application.   If it 
 only returns the alarms added by the app itself, then what would be the 
 correct procedure to get the Alarm from the clock app. Will I have to use 
 alarmdb.js to retrieve them?

Apps are bound by the same-origin policy, just like normal web pages. Which 
means you cannot access anything the clock app is doing from another app. If 
you really need to get the list of alarms added by the clock app, you'll have 
to add Inter-App Communication API support to the clock, get it landed in Gaia 
(with a requisite justification of strong enough use cases for this feature) 
and then have your app talk to clock over IAC.

Regards,
Nikhil
___
dev-b2g mailing list
dev-b2g@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-b2g


Re: [b2g] Firefox OS Simple Push not working properly

2013-09-13 Thread nsm . nikhil
On Thursday, September 12, 2013 5:12:41 PM UTC-7, Vidor Gencel wrote:
 I can't believe this. When we use Telefonica push servers everything works 
 perfectly!
 
 Does anybody know when will the mozilla push servers be in production mode?

I was going to say this might be a problem - https://bugzil.la/823247

but maube it is a server issue. Can you try on 3g with the mozilla servers?
___
dev-b2g mailing list
dev-b2g@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-b2g


Re: [b2g] Issues with Simple Push on 1.1 (Keon and Peak)

2013-07-25 Thread nsm . nikhil
On Thursday, July 25, 2013 8:37:40 AM UTC-7, Michael Diener wrote:
 One last thing: This also happens for packaged apps, just tested it.
 
 
 
 
 
 On Thursday, July 25, 2013 5:30:52 PM UTC+2, Michael Diener wrote:
 
  I did a bit more research and the problem seems to be that the files 
  defined under messages in the manifest do net get called if the app is 
  not running. 
 
  
 
  
 
  
 
  This is not just about Simple Push, but also happens for alarms through 
  MozAlarmsManager:
 
  
 
  
 
  
 
  messages: [
 
  
 
  { alarm: /push-message.html }
 
  
 
  ],
 
  
 
  
 
  
 
  The file is never called when the alarm should trigger. Is there a general 
  issue with the system messaging?
 
  
 
  
 
  
 
  According to the spec ( http://runtime.sysapps.org/#system-messages ) the 
  app should be started when not running, but again, this does not happen:
 
  
 
  ... Otherwise, if the application is not running, the UA must add the 
  message to the pool of messages and start the application ...
 
  
 
  
 
  
 
  
 
  
 
  
 
  
 
  On Thursday, July 25, 2013 1:48:21 PM UTC+2, Michael Diener wrote:
 
  
 
   I'm able to get an endpoint successfully, but after that the issues start.
 
  
 
   
 
  
 
   
 
  
 
   
 
  
 
   The messages attribute from the manifest gets ignored or at least the 
   files listed there will never be called (no matter what they contain):
 
  
 
   
 
  
 
   
 
  
 
   
 
  
 
 messages: [
 
  
 
   
 
  
 
 { push: /ff/push-message.html},
 
  
 
   
 
  
 
 { push-register: /ff/push-message.html}
 
  
 
   
 
  
 
 ],
 
  
 
   
 
  
 
   
 
  
 
   
 
  
 
   
 
  
 
   
 
  
 
   Normally the following code would be within push-message.html (as 
   suggested by the official Simple Push example):
 
  
 
   
 
  
 
   
 
  
 
   
 
  
 
   window.navigator.mozSetMessageHandler('push', function(e) {
 
  
 
   
 
  
 
 console.log(endpoint reached);
 
  
 
   
 
  
 
   });
 
  
 
   
 
  
 
   
 
  
 
   
 
  
 
   But as push-message.html never gets called, I put it instead in my main 
   page and the handler gets successfully called. The downside to this is 
   that it only gets called, if the app is in memory (in fore- or 
   background). If it is not (e.g. if device just started and app was not 
   started yet), nothing is called.
 
  
 
   
 
  
 
   
 
  
 
   
 
  
 
   Am I doing something wrong or are these 2 issues known bugs or even 
   limitations?
 
  
 
   
 
  
 
   
 
  
 
   
 
  
 
   This is about a hosted app (not a packaged app) in case it matters.
 
  
 
   
 
  
 
   
 
  
 
   
 
  
 
   Thanks,
 
  
 
   
 
  
 
   Michael


Hey Michael,

Until Bug 800431 is fixed, system messages can only be delivered to the page 
that signed up for a particular API. That is, only the page which called 
navigator.push.register() or mozAlarms.add() will receive the corresponding 
system message. Please let us know if switching to one page works.

Best,
Nikhil
___
dev-b2g mailing list
dev-b2g@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-b2g