[Google][API] Error: 這個應用程式未經驗證 (This app isn’t verified)

Intro Google OAuth 應用授權大概在2017-07-18後會遇到以下問題: 這個應用程式未經驗證 這個應用程式尚未經過 Google 驗證。除非你認識且信任開發人員,否則請勿繼續執行。 隱藏進階設定 Google 尚未審查這個應用程式,因此無法確認其是否通過驗證。未經驗證的應用程式可能會對你的個人資料造成危害。 瞭解詳情 前往「yidas.com」(不安全) 解決方法 Google – OAuth Client Verification

[GoogleAPI][v2][PHP] Google_Client OAuth Token Refresh (getrefreshtoken return null) – 更新Token

情境 PHP SDK文件與範例Code目前版本就是有坑:例如Calendar PHP Google Client OAuth Token就是無法Refresh,調用Method出來就是NULL。 $client->getRefreshToken(); // Output = NULL 解決方法 設定Google_Client時ApprovalPrompt要設為Froce… $client->setApprovalPrompt(‘force’); 修正後的PHP SDK範例: $client = new Google_Client(); $client->setApplicationName(APPLICATION_NAME); $client->setScopes(SCOPES); $client->setAuthConfig(CLIENT_SECRET_PATH); $client->setAccessType(‘offline’); $client->setApprovalPrompt(‘force’); 可以參考2011年文章:Upcoming changes to OAuth 2.0 endpoint

[GoogleAPI][Calendar][PHP] Events: Update DateTime – 日曆更新時間範例 (Google_Service_Calendar_EventDateTime)

緣由 Google Calendar API 目前文件版本在Events Update上竟然沒說明DateTime的相關set方法。 基本文件 Google Calendar API Events: update 以上目前版本並無提及如何Update Start & End DateTime,僅提到使用nested object型態。 PHP範例CODE // First retrieve the event from the API. $event = $service->events->get(‘primary’, ‘eventId’); $event->setSummary(‘Appointment at Somewhere’); // DateTime nested object method $start […]