English | 中文
Hmsanalyticskitdemo provides an example of integrating HUAWEI Analytics Kit with an app. It illustrates how to collect predefined events and custom events on two pages, namely, question page or user attribute setting page. If you click TRUE or FALSE on the question page, automatically collected events including page exit and page entry will be logged when the page is switched. Read more about Hianalytics.
For more development guidance, please refer to the links below:
In this example, we demonstrate how to use the analytics SDK for iOS by using the CocoaPods Tool, a dependency manager for Swift and Objective-C Cocoa projects.
First download the demo by cloning this repository or downloading an archived snapshot.
Open the CLI and navigate to the location of the Xcode project. Edit the Podfile file, add pod 'HiAnalytics', that is, the dependency for pod.
Install the pod and open the .xcworkspace file to view the project.
You should create an iOS app in AppGallery Connect, and obtain the agconnect-services.plist file and add it to the project. You should also generate a signing certificate fingerprint and add the certificate file to the project. More to Development Process
Use Xcode to open the decompressed project.
- Create an iOS app in AppGallery Connect and obtain the project configuration file agconnect-services.plist. In Xcode, switch to the Project view and move the agconnect-services.plist file to the root directory of the app.
Hardware requirements:
- A MAC computer (desktop or laptop)
- A iPhone phone, which is used to debug the developed app
Software requirements:
- HUAWEI Analytics Kit 5.2.0.300
- Xcode
After running the app you should see a screen.
And click the button TRUE or FALSE to answer the question; Click the Setting to set user profiles.
Click button SETTINGS: When you click the Setting button, you will be asked for your favorite sports. These information will be logged as users attributes by HUAWEI Analytics Kit.
If you want to evaluate more about HMS Core, r/HMSCore on Reddit is for you to keep up with latest news about HMS Core, and to exchange insights with other developers.
If you have questions about how to use HMS samples, try the following options:
- Stack Overflow is the best place for any programming questions. Be sure to tag your question with
huawei-mobile-services
. - Huawei Developer Forum HMS Core Module is great for general questions, or seeking recommendations and opinions.
If you run into a bug in our samples, please submit an issue to the Repository. Even better you can submit a Pull Request with a fix.
HmsAnalyticsKitDemo is licensed under the Apache License, version 2.0.