Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
NotificationsYou must be signed in to change notification settings

hyperdevs-team/quantum-spm-mirror

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Welcome to the Quantum Metric iOS SDK Swift Package! Please review the instructions below once you've installed the package.

Integration Guide

Add Linker FlagStep 1: Go to Build Settings in your Xcode Project.Step 2: Filter forOther Linker Flags.Step 3: Add-ObjC to the list if not already added.

Additional Steps for Swift Projects

If the project does not already have a Bridging Header, create one by completing the following steps. (Or, refer toApple's Bridging Header Documentation)

  1. UnderFile -> New -> File, selectHeader File, and name the file something likeMyApp-Bridging-Header.h

  2. In your target's Build Settings, under theObjective-C Bridging Header settings, add the path to the new Header File you just created (this normally needs to include your app name – for example:MyApp/MyApp-Bridging-Header.h).

Once you have the bridging header settup, openMyApp-Bridging-Header.h and add#import "QMNative.h" to allow Objective-C headers to be available in Swift.

Configure Quantum Metric within your App Delegate

Within your App Delegate'sapplication:didFinishLaunchingWithOptions: method, initialize QMNative.

Objective-C

#import "QMNative.h"; //add to the top of the file  [QMNative initializeWithSubscription:@"yoursubscription" uid:@"youruid"];

Swift

QMNative.initialize(withSubscription: "yoursubscription", uid: "youruid")

Done! You're ready to use the Quantum Metric iOS SDK.

Note on Crash Reporting

Quantum Metric has crash reporting out of the box, however, if your app uses another service for crash reporting such as Crashlytics or Sentry, you can disable QM's internal crash reporting with the following (add this line after the initialize line):

Swift

QMNative.disableCrashReporting()

Objective-C

[QMNative disableCrashReporting];

Viewing your first session

Once you have the call toinitializeWithSubscription:uid: in your app delegate, run your application and click around a bit. Within a few moments, you should see the session appear within your subscription. To find it more easily, you can search forplatform is iPhone to show sessions from iPhones (or simulators).

Debugging

Using the session callback

If you don't see your session appear, or can't find it, we can use the session callback to search for the session based on the session id. After the line that starts QM inside of your app delegate, use the session callback API to log the session information.

Swift

QMNative.gotSessionCookieCallback{(session, user)iniflet sessionCookie= session{NSLog("Quantum Metric: got session cookie: %@", sessionCookie);}};

Objective-C

[[QMNativesharedInstance]gotSessionCookieCallback:^(NSString *sessionCookie,NSString *userString) {NSLog(@"Quantum Metric: got session cookie:%@", sessionCookie);}];

Run your app again and search your logs forQuantum Metric. You can use the logged session cookie to search for your session, withQM Session Cookie is abc123. If you don't see theQuantum Metric log after adding the above snippet, your session didn't start because the configuration was setup in a way that excluded your session from capture, or the configuration json could not be downloaded.

Sending Events Manually

Using an Event ID, which can be found in the Quantum Metric Web UI inSettings > Events, a new Event and its value can be sent through the SDK, using the following syntax:

Objective-C

[QMNativesendEventWithID:10value:@"Hello World!"];

Swift

QMNative.sendEvent(withID:10, value:"Hello World!")

Some Events signify special situations, such as conversions. These special cases can be flagged using an optional set of EventType arguments as follows:

Objective-C

[QMNativesendEventWithID:10value:@"Hello World!"flags:QMEventTypeCartValue];

Swift

QMNative.sendEvent(withID:10, value:"Hello, world", flags:QMEventTypeFlag.cartValue)

Tip: Some useful EventType options areQMEventTypeFlag.conversion,QMEventTypeFlag.cartValue andQMEventTypeFlag.encrypted

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp