Delacy in GCM Message Recieving

30 views
Skip to first unread message

Pratibha Verma

unread,
Apr 27, 2015, 6:54:11 AM4/27/15
to gcm-for-chr...@googlegroups.com
Hi all,

I am creating Chrome Extension. I am facing problem in GCM Message recieving. If i am online than message deliver instantly. But as soon as i went offline and opens my chrome again. I do not get message instantly. SomeTimes It takes even  more than an hour to recieve message. When i use
{

"name": "GCM Notifications",

"description": "Chrome platform app.",

"manifest_version": 2,

"version": "0.1",

"app": {

"background": {

"scripts": ["background.js"]

}

},

"permissions": ["gcm", "storage", "notifications"],

"icons": { "128": "gcm_128.png" }

}



 it works  perfect But as soon as i write it like 
{

"name": "GCM Notifications",

"description": "Chrome platform app.",

"manifest_version": 2,

"version": "0.1",



"background": {

"scripts": ["background.js"]

},


"permissions": ["gcm", "storage", "notifications"],

"icons": { "128": "gcm_128.png" }

}
it runs late.. Please tell me how to come out of this problem.

Filip Gorski

unread,
Apr 28, 2015, 1:01:07 PM4/28/15
to gcm-for-chr...@googlegroups.com
Hi, Pratibha,

When you are altering the manifest file like that you are switching from being app to extension. I think you should try to use additional key in the second manifest: "persistent": false, which would turn your background.js into an event page.
https://developer.chrome.com/extensions/event_pages (Extension event pages - explaining the persistent flag)
https://developer.chrome.com/extensions/background_pages (Explanation of what else you could do for extension's background page, like adding the "background" permission)

thanks.
Filip
Reply all
Reply to author
Forward
0 new messages