Get Started
Part 1: Pre-Requisites
Enable SandboxMode
To fully test the Playtime SDK integration and access all campaign types, configure your application to be in "SandboxMode". Contact your Account Manager to have this setting enabled for your environment.
Troubleshooting: If you do not see any apps returned or if you run into any errors after this setting is enabled, please try a fresh install.
Add the Dependency
The Swift Package Manager automates the distribution of Swift code. To use Playtime with SPM, add the dependency: https://github.com/adjoeio/adjoe-monetize-spm.
With Xcode
Go to File → Add Package Dependencies in the Menu Bar in Xcode. Search for https://github.com/adjoeio/adjoe-monetize-spm and add it to your app's target.
Using Package.swift file
If your project uses Package.swift file, add Playtime as a dependency:
dependencies: [
.package(url: "https://github.com/adjoeio/adjoe-monetize-spm", from: "4.1.1")
]And then add the following product to any target that needs access to the library:
.product(name: "PlaytimeMonetize", package: "adjoe-monetize-spm")CocoaPods is a dependency manager for Cocoa projects. For usage and installation instructions, visit their website.
In your project directory, create a
Podfileif one doesn’t already exist.Inside the
Podfile, add the following configuration to include the Playtime SDK as a dependency within your app’s target. You can also specify a version or version range—see the CocoaPods Podfile syntax reference for more details.source 'https://github.com/adjoeio/PlaytimeSpecExternal.git' platform :ios, '14.0' target 'MyApp' do use_frameworks! pod 'PlaytimeMonetize', '~> 4.1.1' endOpen a terminal and navigate to your project’s root directory.
Run the following command to update the CocoaPods repository and install the dependencies:
pod install --repo-updateOnce installation is complete, open the
.xcworkspacefile generated by CocoaPods. The Playtime SDK will now be available for use within your project.
Check out our troubleshooting guide if you run into any issues with Cocoapods
Obtain a release archive from adjoe and extract the
.xcframeworkfrom it. Place within your project’s root folder.Link the framework with your target:
Go to the Project Navigator
Select your target
Go to the General tab
Go down to the section Frameworks, Libraries, and Embedded Content
Click on add a new file
Choose the
.xcframeworkSet Embed & Sign.

Part 2: App Attest Integration
The Playtime SDK for iOS makes use of Apple's DeviceCheck APIs to ensure that the app is launched on a real device and that there haven't been any malicious alterations. This allows us to better protect your app and your revenues.
To ensure that the SDK runs as expected, you must complete the following steps, even if the app builds normally. Failure to complete a step could cause the app to disfunction or be rejected from the App Store. You can read more about the App Attest service here.
Enable App Attest
Select your app ID
Ensure App Attest is enabled under Capabilities

Gather Credentials:
In order for adjoe's services to work with your app, the following credentials will need to be enabled for your app. They can be uploaded at the app-level in the Monetize Dashabord.
If you plan on using a dev and a prod environment, you will need to make sure distinct credentials are added for both app bundles, e.g., playtime.app.dev and playtime.app.
Private Key: Generate a private key that can be used for the AppAttest service and provide the file with the
.p8extension to adjoe. You can find the instruction on how to get the.p8here. Only the DeviceCheck/AppAttest Service should be added.

Key ID: Generate a key identifier associated with the enabled service.
Team ID: Provide the Team ID, which app ID prefix: Team ID and the Bundle ID separated with a dot, for example:
M4CAP9HPPJ.com.my.app. You can learn more about the app ID here.
Make sure that after you add the capability to your project, you can see the .entitlements file. Specify the production environment.
Do not use the same credentials, i.e., team ID, with device check for your own app. adjoe should be the only one using the AppAttest / DeviceCheck service with your team ID.
Part 3: Configure Environment
After adding the App Attest capability, you must configure your entitlements file to use the production environment. The adjoe backend only accepts production App Attest attestations.
Steps:
Set to production environment
Open the
.entitlementsfileFind the key:
com.apple.developer.devicecheck.appattest-environmentSet the value to
production(NOTdevelopment)
Your entitlements file should look like this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.developer.associated-domains</key>
<array>
<string>webcredentials:prod.adjoe.zone</string>
</array>
<key>com.apple.developer.devicecheck.appattest-environment</key>
<string>production</string>
</dict>
</plist>Why production is required:
Unlike typical Apple services, the adjoe backend does not support development App Attest attestations
Both your development/testing builds and production builds must use the
productionenvironmentUsing
developmentwill cause authentication failures with the error: "AAGUID not found in metadata"
Troubleshooting: If you see errors related to "AAGUID not found" in your logs, it means your entitlements are still set to development. Double-check steps 1-3 above, clean your build folder (Product → Clean Build Folder), and rebuild.
Part 4: Terms and Conditions
As a Playtime Studio Partner, the expectation is that adjoe's Terms and Conditions are included within the partner's own T&C. You must update your sign-in and add in adjoe's T&C.
Part 5: App Tracking
While the IDFA parameter is not required, we strongly recommend including it. It's purpose is to help attribute installs and ensure that users are rewarded.
The App Tracking Transparency popup should be triggered in the app before showing games to users. The user must then "Allow" tracking. The Playtime SDK accesses the IDFA via Apple's API.
Last updated

