获取报告数据,如何能够不弹出授权窗口

32 views
Skip to first unread message

Radision Sun

unread,
Apr 19, 2022, 2:36:48 AM4/19/22
to AdMob API Developer Forum
您好!

我用 PHP 每两个小时获取一次 admob 的 GenerateMediationReport
需要手工在弹出窗口进行授权以后,才能获取报告数据,这样很不方便,
因为我希望程序在服务器上运行,不需要人工去操作

有没有使用PHP,而不弹出授权窗口的方法?谢谢!

AdMob API Forum Support

unread,
Apr 26, 2022, 5:38:52 PM4/26/22
to radi...@gmail.com, google-admob-api...@googlegroups.com
Hello,

Thank you for reaching out to the developer forum. To avoid manually authorizing the user consent screen each time your access token expires, you will need to save the refresh token, which can then generate new access tokens. This includes adding the lines below to the client configuration settings to save the refresh token. Additional details can be found in this thread.
 
// Offline access will give you both an access and refresh token so that
// your app can refresh the access token without user interaction.
$client->setAccessType('offline');
// Using "force" ensures that your application always receives a refresh token.
// If you are not using offline access, you can omit this.
$client->setApprovalPrompt("force");
All the best,
Google Logo
Amira
AdMob API Team
 

 

ref:_00D1U1174p._5004Q2a4aj8:ref
Reply all
Reply to author
Forward
0 new messages