Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languageswift
import RelatedDigitalIOS
import UserNotifications

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        RelatedDigital.initialize(organizationId: "YOUR_ORGANIZATION_ID, profileId: "YOUR_PROFILE_ID, dataSource: "YOUR_DATA_SOURCE", launchOptions: launchOptions)
        RelatedDigital.enablePushNotifications(appAlias: "YOUR_APP_ALIAS", launchOptions: launchOptions, appGroupsKey: "YOUR_APP_GROUP_KEY", deliveredBadge: true)
        UNUserNotificationCenter.current().delegate = self
        RelatedDigital.loggingEnabled = true
        RelatedDigital.inAppNotificationsEnabled = true
        if #available(iOS 13, *) {
            // handle push for iOS 13 and later in sceneDelegate
        } else if let userInfo = launchOptions?[UIApplication.LaunchOptionsKey.remoteNotification] as? [String: Any] {
            RelatedDigital.handlePush(pushDictionary: userInfo)
        }
        return true
    }

...