SDK supports URL schema deeplink. If target url has a valid link, it will redirect to related link.
Dengage.Framework is available through CocoaPods. To install it, simply add the following line to your Podfile:
Dengege provides REST API url address to send subscription and events. By default URL adresses are Dengage’s own servers.
https://push.dengage.com/
event.dengage.com/api/event
For initial setup, if you have given URL addresses by Dengage Support team, you need to setup url address by using Plist
file. Otherwise you don’t need to add anything to Plist
file
After CocoaPods installation, you can access SDK’s methods by importing Dengage_Framework
import Dengage_Framework
Now, you can access SDK methods.
Integration Key
is genereted by CDMP Platform while defining application. It is a hash string which contains information about application.
At the begining of your application cycle you must set Integration Key.
To set integration key SDK Provides Dengage.setIntegrationKey(key: String)
method.
Call this method at the begining of your application life cycle.
Recommendation : Use it on AppDelegate
After setting Integration Key, to use SDK features, Dengage.initWithLaunchOptions(withLaunchOptions: [UIApplication.LaunchOptionsKey: Any]?,badgeCountReset: Bool?)
function must be called.
Parameters:
withLaunchOptions
: [UIApplication.LaunchOptionsKey: Any]?
: Pass didFinishLaunchingWithOptions
paramsbadgeCountReset
: bool
If you want to reset (clear) badge icon on your notifications set this option to true
Sample:
Subscription
is managed by SDK by itself. But SDK provides a method to developer for manual managment too.
Definition: Subscription is a process which is triggered by sending subscription event to Dengage. It contains necessary informations about application to send push notifications to clients.
Subcription cycle starts with Prompting user permission. SDK will automaticlly send subscription events under these circumstances;
IOS uses shared UNUserNotificationCenter
by itself while asking user to send notification. Dengage SDK mananger UNUserNotificationCenter
to ask permission as well.
Referrer: Apple Docs
In you application cyle if you want to get UserNotification permission you must call:
Dengage.promptForPushNotifications()
or
Note: Callback method provides information if user enables or disables notification permission from iOS
Settings > Notifications
.
If you manage your own user permission states on your application you may send user permission by using setUserPermission
method.
Push tokens can be set by Dengage.setToken(token: String)
method.
Definition : Push token is a data type which will be provided by APNS. By using token, CDMP can push notifications to client application.
promptForPushNotifications
method will trigger func application( _ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data)
method for push token which has to be set by a method.
Sample:
To track devices by their contacts you need to set contact key on SDK.
Definition Contact Key represents a value which has a relation with Devices and Contacts. There are two types of devices. Anonimous Devies and Contact Devices. Contact Devices contains Contact Key.
Method:
Recommended Usage: You can call this method on your Login
or Logout
methods.
SDK can provide logs for debuging. It displays queries and payloads which are sent to REST API’s.
To validate your inputs you can enable SDK’s log by a method.
Parameters:isVisible
: bool
By default isVisible
set to false.
SDK provides a method if you want to get and parse payload manually for custom parameters or etc.
Method:
Sample: