1.基于AWS的iOS APP Analytics(配置篇)

目的

1.基于Amplify搭建aws的分析服务端。
2.client集成,AWSPinpoint来实现发生event。

import AWSPinpoint
import AWSMobileClient

aws教程和源码:

https://aws-amplify.github.io/docs/ios/analytics
https://github.com/aws-samples/aws-mobile-ios-notes-tutorial/blob/master/tutorial/analytics.md

一,配置服务器

1.需要用Amplify来配置aws的服务端

Analyze User Behavior - You can view trends about your users’ level of engagement, purchase activity, and demographics. You can monitor your message traffic with metrics for messages sent and opened. Through the Amazon Pinpoint API, your application can report custom data, which Amazon Pinpoint makes available for analysis.

The Amplify CLI helps setup and configure Pinpoint within your application and connect with the AWS Mobile SDK.

Prerequisite: Install and configure the Amplify CLI
Recommendation: Complete the Getting Started guide

配置教程

  1. 安装node.js和npm
  2. 安装Amplify CLI,和设置config
$ npm install -g @aws-amplify/cli
$ amplify configure
  1. 在项目文件中,配置amplify
 $ cd ./YOUR_PROJECT_FOLDER
 $ amplify add analytics

4.When configuration for analytics is complete, a message appears confirming that you have configured local CLI metadata for this category. You can confirm this by viewing status.

 $ amplify status
 | Category  | Resource name   | Operation | Provider plugin   |
 | --------- | --------------- | --------- | ----------------- |
 | Auth      | cognitoabcd0123 | Create    | awscloudformation |
 | Analytics | yourprojectname | Create    | awscloudformation |

5.To create your backend AWS resources run the following:

$ amplify push

6.Update your IAM Policy: ?????

二,客户端的处理

1.在podfile中添加

platform :ios, '9.0'
target 'YourAppName' do
    use_frameworks!
    pod 'AWSPinpoint', '~> 2.9.0'
    pod 'AWSMobileClient', '~> 2.9.0'
end

三,如何查看视图,Monitor Analytics

通过命令行

$ amplify console analytics
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 12,183评论 0 10
  • “天生愚妄已够糟,学而愚妄更受不了。” “不管你怎么说,无赖大多是笨蛋。” “打断蠢人的话头,让他闭口,是失札的,...
    阿俊xi阅读 4,705评论 0 0
  • 你的笑 如甘蔗 脆甜 让我回味无穷 我想 化作叶子围着你 你的笑 如香醇 纯香 让我沉醉迷恋 我想 化作香气绕着你...
    叶儿朵朵阅读 6,637评论 4 7
  • 这时他打来电话“你这次出去散心回来,我们把婚离了吧……” “好啊,好啊,你准备好了,我分分钟,或者说秒秒钟签字……...
    拈花一笑225678阅读 1,513评论 0 0

友情链接更多精彩内容