小编rds*_*rds的帖子

Firebase 云消息传递 HTTP V1 API:如何通过 REST 调用获取 Auth 2.0 访问令牌?

为了将HTTP V1 API(而不是旧版 API)与 PHP 一起使用,必须使用 REST 接口。

https://firebase.google.com/docs/cloud-messaging/send-message#top_of_page

我想知道如何获取 Auth 2.0 访问令牌?

https://firebase.google.com/docs/cloud-messaging/auth-server

由于 PHP 没有Google API Client Library(请参阅上面链接中的示例),如何通过 REST 调用接收 Auth 2.0 令牌(无需显示 PHP 代码)?

相关问题:一旦收到这个短暂的令牌,如何刷新这个令牌?工作流程是怎样的?

多谢!

php rest firebase firebase-cloud-messaging

7
推荐指数
2
解决办法
5147
查看次数

iOS共享扩展使用Swift更改预览图像的大小

在iOS共享扩展中,可以使用loadPreviewImageWithOptions获取预览图像.是否也可以更改预览图像的大小?

预览图像似乎是网站的屏幕截图.我想知道是否有可能获得原始大小的屏幕截图.

据记载,可以为选项创建字典.

https://developer.apple.com/library/prerelease/ios/documentation/Foundation/Reference/NSItemProvider_Class/index.html#//apple_ref/doc/constant_group/Options_Dictionary_Key

出于这个原因,我使用以下代码(尝试使用不同的值).

let options: [String: NSValue] = [NSItemProviderPreferredImageSizeKey: NSValue(CGSize: CGSizeMake(375.0, 600.0))]
itemProvider.loadPreviewImageWithOptions(options, completionHandler: { [ weak self ] image, error in
    if let image = image as? UIImage {
    }
})
Run Code Online (Sandbox Code Playgroud)

但结果始终是尺寸为84 x 79的图像

谢谢!

ios swift ios8-share-extension

5
推荐指数
0
解决办法
483
查看次数