Use Countly to analyze Apple Watch statistics

Source: Internet
Author: User

Use Countly to analyze Apple Watch statistics

The long-awaited Apple Watch has purchased nearly 1 million pre-orders on the day of its release and has begun to deliver the product globally. Considering that the sales volume of Apple Watch has been reached within one day, we can say that smart watches will be a more important part of users' life, especially compared with smart watches that have been sold in the market for many years.

The iPhone, along with a smart Watch that is fully compatible with Apple Watch, will bring some changes in IOS app usage habits and practices. From now on, many IOS apps will be able to be configured once on the iPhone, and more will be used on the Apple Watch extension later. Quickly display important information, give choices, and use simple interactions to make a variety of actions, and provide basic data for motion and medical applications through new sensors, these are only part of the new features of Apple Watch. With these new features, users have a new space for interaction and experience in mobile apps. Maybe we will see the transformation from smartphones to smart watches, because we once saw the transformation from PCs to smart phones and also the means of user participation and network traffic.

Based on this, Apple applications that provide better user experience for Apple watches will be equally important to provide better user experience for Apple mobile phones. At the top of the app page of the Apple Store, set the "app provided for the Apple mobile phone" identifier to display its importance.

Collecting and analyzing usage policies and data on Apple mobile phones is the key to providing better user experience for Apple watches. We provide mobile application analysis solutions for Countly, push notifications and crash reports (coming soon), and strive to keep up with new technologies emerging every day. Therefore, we strive to provide support for IOS sdks and servers of Apple mobile phones. It is not completed yet, but we have prepared a tutorial to show you how to use the Countly ios sdk currently provided for WatchKit in your Apple Watch app.

First, open a new or existing Xcode project and click the + icon under the project or target list to add a target. (If your project already has a Watch App, you can jump to Step 4, or access the http://apple.co/1PnD1uT for more information .)

  • Select the target template WatchKit AppunderiOS> Apple Watchsection. (To simplify things, the target does not contain icationicationandglancescenes)

  • If Xcode asks if you want to activate WatchKit Appscheme, Click Activate.

  • Now you need to create an application to share the common database between the main iOS application and the Watch expansion program.
    (If you have activated the APP Group to add the container you want to use, then jump to Step 1 or access the http://apple.co/1IFdNCJ for more information)

  • In the project and target lists, select the main iOS App to create an App Group. Switch to Capabilitiestab. Go to the App Groups page and open the switch.

  • After entering the developer account creden。, Xcode will add App Groupsentitlements in your project.

  • On the App Groups page, click + to add a container. You can name it at will, as long as it is synchronized with the Group and followed by a reverse DNA identifier like the App ID.

  • Switch to WatchKit Extensiontarget (not the WatchKit application) in the project and target list and open the application Groupscapability.

  • When you open it, you will see an app group container you created in Step 7, select it.

  • After creating App Groups and containers, install the Countly iOS SDK in WatchKit to support your project. You can download here: https://github.com/erkanyildiz/countly-sdk-ios

  • After you have copied the Countly iOS SDK, make sure to use git commandgit to check the watchkit branch.

  • Drag & Dropcountly-sdk-iosfolder to your project. In the following dialog box, make sure that the iPhone apptarget and WatchKit Extensiontarget (not the WatchKit application) are selected, copy the project as needed.

  • Then add-DCOUNTLY_TARGET_WATCHKIT = 1 flag to the constructor of the target expansion of other C FlagsunderWatchKit.

  • Import Countly. hinInterfaceController. musing # import "Countly. h"

  • Add common Countly startup code to awakeWithContext: (id) contextmethod ofInterfaceController. m [Countly. sharedInstance start: @ "YOUR_APP_KEY" withHost: @ "http: // yourserver"];

  • Now you can try to build a project and get an error: No Application Group Identifier is specified. Please cancel the above line or specify it. Add the Application Group Identifier created in Step 7 to the countlyDB error prompt.

  • Rebuild the project after adding the Application Group Identifier. It should be okay now. Run the WatchKit App and you can see the dialog box in the Countly control panel. This custom event tracking is equivalent to that of the iPhone app. For more details, see: http://resources.count.ly/v1.0/docs/custom-events-sdk-methods

Now you are ready to track your Apple Watch with Countly applications. By the way, the session concept of the Apple Watch is a little different from that of the iPhone, so it is impossible for a user to completely stop using the app of the Apple Watch, this is because of the current WatchKit APIs limit. Therefore, there are two constant values, which are adjusted accordingly based on your usage. The first one is COUNTLY_DEFAULT_UPDATE_INTERVAL. Its default value is 10 seconds for WatchKit and 60 seconds for iPhone. This value determines how long the update_session request should be sent to the server when your application is in use. The second is COUNTLY_EVENT_SEND_THRESHOLD. The default value is 3 seconds for WatchKit and 10 seconds for iPhone. When the Countly iOS SDK waits for a special event and reaches the critical value of this event, it will send a request to the server until the next update_session request enters. Considering that Apple tables are designed for short session painting, these values are appropriate for the moment. Of course, you can change the application scenario of the watch app according to your needs. As long as we complete more details, we will release the final version supported by WatchKit iOS SDK in our main GitHub account.

Erkan YILDIZ

Countly SDK developer

Analyzing Apple Watch statistics using Countly

This article permanently updates the link address:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.