Configuring Capabilities of App and Extensions
Enabling App Capabilities for App
Note:
- Make sure you add App Transport Security Settings with Allow Arbitrary Loads as YES in Info.plist of App, Service Extension and Content Extension to support http calls.
- App Groups must be same between App, Service Extension and Content Extension.
For Smartech SDK to work, you need to enable below app capabilities in your main app.
- App Groups - Enable/Add and select a valid App Group for your app. This is used by App, Service Extension and Content Extension to access data as all three are different targets.
- Background Modes - Enable/Add Background Modes and select Remote notifications. This used to receive remote notifications in background mode.
- Push Notifications - Enable/Add and Configure App Push Notifications feature for your App ID in Apple Developer Account. This is used to enable the push notifications for the app.
Configure Apps Info.plist with SmartechKeys
You need to add a key named SmartechKeys with type Dictionary. In it add the following keys and values with their types.
Key | Type | Value |
---|---|---|
SmartechAppGroup | String | The app group that is selected in capabilities section. It is used to share data between App and Extensions. |
SmartechAppId | String | The app id received from Smartech panel under assets section. |
Following is the source code snippet of apps Info.plist for key SmartechKeys:
<key>SmartechKeys</key>
<dict>
<key>SmartechAppGroup</key>
<string>group.com.CompanyName.ProductName</string>
<key>SmartechAppId</key>
<string>abcdef123456abcdef123456abcd1234</string>
</dict>
Following is the image representation of apps Info.plist for key SmartechKeys:
Enabling App Capabilities for Service and Content Extension
For our SDK to work in your project you need to enable below app capability in both of your extensions.
- App Groups - Enable/Add and select a valid App Group for your app. This is used by App, Service Extension and Content Extension to access data as all three are different targets.
You can refer to the below PDF for detailed steps to enable app capabilities in your main app and extensions, refer here
Configure Service and Content Info.plist with SmartechKeys
You need to add a key named SmartechKeys with type Dictionary. Init add the following key and value with its type.
Key | Type | Description |
---|---|---|
SmartechAppGroup | String | The app group that is selected in capabilities section. It is used to share data between App and Extensions. |
Following is the source code snippet of both the extensions Info.plist for key SmartechKeys:
<key>SmartechKeys</key>
<dict>
<key>SmartechAppGroup</key>
<string>group.com.CompanyName.ProductName</string>
</dict>
Following is the image representation of both the extensions Info.plist for key SmartechKeys:
Updated over 4 years ago