-
Notifications
You must be signed in to change notification settings - Fork 4
Include iOS
⚡ Before you start
Make sure you have correctly setup project settings.
- Install Cocoapods
- Link frameworks statically
- Track Location Enabled
- Optional permissions
- Application pause on background
- iOS 15 Global SKAdNetwork Reporting
- Mute Other Audio Sources
- App-Bound Domains
The Clever Ads Solutions Unity plugin is distributed with the EDM4U library. This library is intended for use by any Unity plugin that requires access to iOS CocoaPods. It provides Unity plugins the ability to declare dependencies, which are then automatically resolved and copied into your Unity project.
Make sure that Cocoapods is installed.
In the Unity editor, select: Assets > External Dependency Manager > iOS Resolver > Install Cocoapods
An xcworkspace is generated that includes the required dependency libraries.
.xcworkspace
instead of the standard Xcode project.
🌟 iOS dependencies are identified using CocoaPods. CocoaPods is run as a post build process step.
In the Unity editor, open Assets > External Dependency Manager > iOS Resolver > Settings
menu.
-
Add use_frameworks!
-
Link frameworks statically
The Unity External Dependency Manager will add use_frameworks! :linkage => :static
to your Podfile.
Failing to do this step may result in undefined behavior of the plugin.
In iOS 10, Apple has extended the scope of its privacy controls by restricting access to features like the camera, photo library, etc. In order to unlock rich, immersive experiences in the SDK that take advantage of these services, please add the following entry to your apps plist:
<key>NSPhotoLibraryUsageDescription</key>
<string>Some ad content may require access to the photo library.</string>
<key>NSCameraUsageDescription</key>
<string>Some ad content may access camera to take picture.</string>
<key>NSMotionUsageDescription</key>
<string>Some ad content may require access to accelerometer for interactive ad experience.</string>
You can also use the settings provided by the Unity Player Settings > Other Settings > Usage Description
.
The SDK are not collects location data automatically if the user allowed the app to track the location.
Check mark Track Location Enabled
in Assets > CleverAdsSolutions > iOS Settings
window to collects location data by default.
Or change the flag at any time using the following method:
CAS.MobileAds.settings.trackLocationEnabled = true;
Indicates if the Unity app should be automatically paused when a full screen ad (Interstitial or Rewarded video ad) is displayed.
Enabled by default.
Change the flag at any time using the following method:
CAS.MobileAds.settings.iOSAppPauseOnBackground = false;
Starting with iOS 15, Apple allows developers to send a copy of their SKAdNetwork install postbacks to an endpoint of their choice.
This feature is available to you in the CAS Unity plugin, starting with version 2.6.0. If you would like to enable this feature, you can do so in the Assets > CleverAdsSolution > iOS Settings
by following these instructions:
- Set Attribution Report endpoint
More about Configuring an Advertised App
Please turn off the option in menu:
Edit > Project Settings > Player > iOS > Other Settings > Mute Other Audio Source
.
We will continue to look for ways to solve the conflict.
In June 2020, Apple introduced App-Bound Domains as an opt-in feature for developers to limit the domains for all WKWebView
in an app to 10 or fewer, through the WKAppBoundDomains
Info.plist key.
If you add the WKAppBoundDomains
key to your Info.plist file, the CAS SDK may fail to load ads.
What’s Next?
- Add iOS solutions to project dependencies.
- Make sure you are Include Android platform as well.
- Project Setup
- Configuring SDK
- Include Android
- Include iOS
- Additional mediation steps
- App-ads.txt🔗