These docs are for v1.0. Click to read the latest docs for v2.0.

Configuring Capabilities of App and Extensions

Enabling App Capabilities for App

📘

Note:

  1. 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.
  2. 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.

  1. 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.
  2. Background Modes - Enable/Add Background Modes and select Remote notifications. This used to receive remote notifications in background mode.
  3. 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.

KeyTypeValue
SmartechAppGroupStringThe app group that is selected in capabilities section. It is used to share data between App and Extensions.
SmartechAppIdStringThe 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:

722

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.

  1. 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.

KeyTypeDescription
SmartechAppGroupStringThe 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:

673