How to access Google Glass contact photos when creating new timeline cards? - google-mirror-api

I am building GlassWare that will add a timeline card to indicate one of a user's friends has performed some action. On the card, I would like to show an image of the friend.
If the Glass user has already added that friend as a Glass Contact, then the device may already have the friend's image. I have the friend's email and am trying to get at that image like so:
Call Contacts/List to get the contacts
Cycle through that list looking for one with a matching email address
Grab the imageUrl from the contact and use it in the html for my new timeline card
I'm facing 2 problems with this approach:
The Contacts/List is coming back empty.
The Contact class doesn't appear to have an email property
Is what I'm trying to do even possible? If so, is there a better way to do this?

What you are trying to do is not possible through Glass. The Contacts that you see are only those that your Glassware has created - your Glassware does not have access to the contacts created by other Glassware. This makes sense from a privacy perspective - a Glass Owner does not necessarily want you to have unrestricted access to who their contacts may be.
You may wish to look into using the Google+ Sign In, which can give you access to those people that a user has specifically given you access to. When the user approves your Glassware, they also approve which people your app can find out about. From here, you can use some of that user's information, including their profile picture.

Related

Create a post on facebook on users behalf using new Sharing Products feature

My scenario:
I have an application within which users keep their own journals. For some of the journal records, i want to enable them to post to their facebook timeline.
It was rather straightforward with an old api (obtaining token and posting) but with a new Sharing Product, it seems impossible because its intended to use ograph data and backlink from facebook post to the page within the app but since the journal post itself is for logged user only, i don't see a way how could it work.
So, the question is:
How to enable users to share (actually, "replicate" is more accurate word) content from their authorization protected area within my application to their facebook timeline?
PS.
I am aware of solutions like: Auto post (user behalf) on facebook but that's an old api.
You can not create new content like this any more in any automated way, you can only let your users share links.
But you can point the Share button to any URL you like (parameter href), it does not have to be that of the current page.
Facebook will follow whatever you have set as og:url or canonical, so that would have to be the version without authorization then.
That would also be the URL that users clicking on the link in that post would be redirected to.

take and upload picture using Mirror API for Glass

while it's possible to send image to glass in a timeline card, it doesn't look like it's possible to to the opposite (take a picture and upload it).
If I'm correct, this operation would be performed as a user action in the mirror APIs (like SHARE, REPLY, NAVIGATE), but I don't see any camera related function.
While you can't add a user action to take a photo directly from one of your timeline cards, you can register a Contact and Subscription to receive photos.
When the user takes a photo using the normal camera function of Glass, they can then SHARE the photo with your Contact and you will get a notification at the endpoint you specified in the Subscription.
See the following URLs as reference:
https://developers.google.com/glass/contacts#how_sharing_works
https://developers.google.com/glass/subscriptions#shared_picture

Mirror API or Glassware - adding an app to contact list

How do I add an app to the user's contact list to be able to share things such as pictures or videos with?
Your Glassware needs to create a Contact for the user once they have added your Glassware. They may later be used as a share target.
See https://developers.google.com/glass/contacts for general information about contacts and https://developers.google.com/glass/v1/reference/contacts for information about how to create contacts from your Glassware and manage the contacts your Glassware creates.
Once you create a contact, the user will be able to share with it fairly quickly, but they are also able to turn off that share contact from their MyGlass page or app.

Invitation code and users database in Wordpress

I need your precious help. I'm working hard on organizing a contest linked to a wordpress site. That's the way it should work:
There's a contest. The user have to register as new user in WP (there's also the Facebook Connect/Open Graph) to enter the contest.
When a new user register himself, the system sends him an email: "Congratulations! You are a new user. Here there are some invitation codes (or links) to invite your friends. If they register here with the invitation code (or link), you'll receive a gift".
How can i do this workflow? I need to generate some codes (or links) every time a new user enter the WP site and assign them (linking those data to the users). I need to know if a new user (called B) comes to my site thanks to another user (called A), in order to give to A a gift.
Thank you guys.
You must make a frontend registration. Then, after user is registered you send him an email like www.yourdomain.com/register?uid=his_id(link to te registration form with his id as a parameter).
The when he passes the link to his friend B, friend B is registering and you check if there's a $_GET['uid']. It yes you add him a meta containing the id.
To make a front-end registeration, you should check this article.
For mail sending you could use wp_mail() function.
For passing params in the url and accessing you must be familiar with $_GET
For adding a meta for an user you must use the add_user_meta(). function.
The above steps are not necessarily difficult if you know basic PHP and willing to learn from Wordpress codex.
We created a plug called Cm Invitation Codes that allows you to assign codes per groups. This way you can know from which site each registration is coming and control also the number of user registration from a specific site. Try CM Invitation Code in WordPress Plugin Directory http://wordpress.org/extend/plugins/cm-invitation-codes/

Do I need back-end and database for single page app using Facebook Connect?

I want to create a one page site that will use Facebook Connect and allow my friends to reserve a spot for an upcoming event. Using there Facebook ID I would like my friends to pay(reserve) a spot and then show their Facebook picture in the spot they reserved. Sort of like Meetup.com when you RSVP except its a one page site and for a one time event. Can I build this only using front-end technologies or do I need a backend?
The answer is yes, you will need a back end system to store the paid registrants, print out a list of paid users to have at the door of the event to make sure they paid, store the user id to be able to display their picture, etc. etc. etc.

Resources