Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/growingio/growingsdk-ios-growingpushextensionkit
https://github.com/growingio/growingsdk-ios-growingpushextensionkit
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/growingio/growingsdk-ios-growingpushextensionkit
- Owner: growingio
- License: mit
- Created: 2019-07-01T08:57:03.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-11-30T13:33:44.000Z (about 5 years ago)
- Last Synced: 2024-08-17T18:35:53.673Z (4 months ago)
- Language: Ruby
- Size: 27.2 MB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GrowingSDK-iOS-GrowingPushExtensionKit
此仓库停止维护,请移步仓库https://github.com/growingio/GrowingSDK-iOS-GrowingTouchCoreKit 最新SDK更新日志查看 https://docs.growingio.com/mp/developers/integrations/changelog
针对iOS10系统及以上的NSNotificationServiceExtension扩展提供的SDK,统计后台通知的到达统计,最低兼容iOS 10系统版本
## 集成方式
### Cocoapods 自动集成
pod 'GrowingPushExtensionKit' 到 Podfile 文件中,特别需要注意的是要添加到不同的 TARGET 中,如下所示,PushDemo 是主工程的 TARGET,而 extension 是扩展的 TARGET。
```
target 'PushDemo' do
// 在主工程集成其他SDK
end
target 'extension' do
pod 'GrowingPushExtensionKit'
end```
项目工程的 TARGETS如下:![vkbAZrG0KHgz5dgg.png](https://uploader.shimo.im/f/vkbAZrG0KHgz5dgg.png!thumbnail)
执行pod update,不要用--no-repo-update选项
### 手动集成
点击链接下载 https://github.com/growingio/GrowingSDK-iOS-GrowingPushExtensionKit/archive/master.zip 解压后将其中的 GrowingPushExtensionKit.framework 添加到 iOS 扩展工程中,选项如下图所示:
![ztg0S5VwVDInMVi4.png](https://uploader.shimo.im/f/ztg0S5VwVDInMVi4.png!thumbnail)## 调用方式
在扩展的通知接收方法中调用通知消息回执接口,代码示例如下:```
- (void)didReceiveNotificationRequest:(UNNotificationRequest *)request withContentHandler:(void (^)(UNNotificationContent * _Nonnull))contentHandler {
self.contentHandler = contentHandler;
self.bestAttemptContent = [request.content mutableCopy];[GrowingPushExtensionKit sendNotificationRequest:request withCompletionHandler:^(NSError* error) {
// 修改通知消息
self.contentHandler(self.bestAttemptContent);
}];
}
```