I have an idea to open the Google Glass native application using GCM service.
Could anybody help me with this. Is that possible.
I have an idea to open the Google Glass native application using GCM service.
Could anybody help me with this. Is that possible.
As of right now, there is no Google Play Services on Glass. Thus you can't register for GCM messages on Glass.
However, I do see GCMBroadcastReceiver
in GlassHome's apk manifest, so I assume, they added (or in progress of adding) some pieces of Play Services. Will see what's gonna happen when they officially release Glass :)
Just to summarize, no, it is not possible to open native Glass app using GCM. At least right now
You can achieve the same thin using the Mirror API to insert a card that can then be used to launch a GDK app. Specifying a menu item as like below will insert a card with a menu that the user can tap to launch
"menuItems":[
{
"action":"OPEN_URI",
"id":"OpenAppId",
"payload":"my.package.name.scheme://open?param1=value1¶m2=value2",
"values":[
{
"displayName":"Accept",
"iconUrl":"https://my_url_dot_com/glass_menu_icons/ic_done_50.png",
"state":"DEFAULT"
},
{
"displayName":"Accepting",
"state":"PENDING"
},
{
"displayName":"Accepted",
"state":"CONFIRMED"
}
]
},
You'll need this intent filter on your Android manifest file:
<intent-filter>
<data android:scheme="my.package.name.scheme" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
And can then access the query params passed in the payload as Intent extras.