oauth - Mirror API auth on server -
i'm trying insert card on glass ios app. in order i've got ios app :
nsurl *url = [nsurl urlwithstring:@"http://mydomain.com/server.php"];
then, server.php send card glass using quickstart project google. when launch script computer, have sign in , after sends card perfectly. however, when try ios app, google sends me it's sign in page.
<?php require_once 'config.php'; require_once 'mirror-client.php'; require_once 'google-api-php-client/src/google_client.php'; require_once 'google-api-php-client/src/contrib/google_mirrorservice.php'; require_once 'util.php'; $client = get_google_api_client(); if (!isset($_session['userid']) || get_credentials($_session['userid']) == null) { header('location: ' . $base_url . '/oauth2callback.php'); exit; } else { verify_credentials(get_credentials($_session['userid'])); $client->setaccesstoken(get_credentials($_session['userid'])); } $mirror_service = new google_mirrorservice($client); $new_timeline_item = new google_timelineitem(); $new_timeline_item->settext("yonewfromapp!"); $notification = new google_notificationconfig(); $notification->setlevel("default"); $new_timeline_item->setnotification($notification); insert_timeline_item($mirror_service, $new_timeline_item, null, null); ?>
i don't know if it's possible authenticate server directly code call api anywhere without signing in.
anyone know how ?
i'm totally new google auth , don't understand doc. thx in advance.
Comments
Post a Comment