Eğer Euromsg SDK 2.0.0 versiyonundan düşük bir versiyon kullanıyorsanız buraya gidin.
...
Bu sayfada:
Table of Contents |
---|
Adım 1 - Gerekenler
iOS Mobil Uygulaması & Xcode |
---|
P12 dosyası & şifresi. P12 Dosyası oluşturmak için tıklayın |
AppAlias (RMC Panelinden alınacak) Eğer bir hesabınız bulunmuyorsa satış temsilcimizle iletişime geçebilirsiniz. Buraya tıklayın. |
Adım 2 - Kurulum
2.1 Euromsg SDK’sı Cocoapods aracılığıyla kurulmaktadır. Aşağıdaki kodu Podfile dosyanıza ekledikten sonra pod install diyerek kurabilirsiniz.
Code Block |
---|
pod 'Euromsg' |
Adım 3 - Uygulamanızı RMC Panele Ekleme
İlk olarak, RMC Panelde sağ üstteki çark ikonu üzerine gelerek Kampanya Yönetimi > Kampanya Ayarları > Push Uygulamaları menüsünden Yeni iOS Uygulaması butonuna tıklayın. RMC uygulamanızı App Alias üzerinden tanır burada uygulamanız için sadece size ait olacak bir App Alias belirleyin.
...
Adım 4 - Kullanım
Notification Service Extension Ekleme
Notification Service Extension zengin push mesajları(görsel, video) almanıza yardımcı olur.
...
Code Block | ||
---|---|---|
| ||
import UserNotifications import Euromsg class NotificationService: UNNotificationServiceExtension { var contentHandler: ((UNNotificationContent) -> Void)? var bestAttemptContent: UNMutableNotificationContent? override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) { self.contentHandler = contentHandler bestAttemptContent = (request.content.mutableCopy() as? UNMutableNotificationContent) Euromsg.didReceive(bestAttemptContent, withContentHandler: contentHandler) } override func serviceExtensionTimeWillExpire() { // Called just before the extension will be terminated by the system. // Use this as an opportunity to deliver your "best attempt" at modified content, otherwise the original push payload will be used. if let contentHandler = contentHandler, let bestAttemptContent = bestAttemptContent { Euromsg.didReceive(bestAttemptContent, withContentHandler: contentHandler) } } } |
Notification Content Extension Ekleme
Not: Eğer push mesajı gönderimlerinizde Carousel Push kullanacaksanız bunu eklemeniz zorunludur.
...
Not bu adımdan sonra “'shared' is unavailable in application extensions for iOS: Use view controller based solutions where appropriate instead.” hatası alırsanız aşağıdaki görselde gösterilen App Extensions seçeneğini kapalı duruma getirin.
...
AppDelegate.swift
İlk olarak Euromsg ve UserNotifications'ı AppDelegeta’e eklemeliyiz
...
Code Block | ||
---|---|---|
| ||
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any]) { Euromsg.handlePush(pushDictionary: userInfo) } func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) { Euromsg.handlePush(pushDictionary: userInfo) } func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) { completionHandler([.alert, .badge, .sound]) } func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) { Euromsg.handlePush(pushDictionary: response.notification.request.content.userInfo) completionHandler() } |
SceneDelegate.swift
willConnectTo fonksiyonun içerisine aşağıdaki kod bloğunu ekleyin.
Code Block | ||
---|---|---|
| ||
if #available(iOS 13, *), let userInfo = connectionOptions.notificationResponse?.notification.request.content.userInfo { Euromsg.handlePush(pushDictionary: userInfo) } |
RMC’ye bilgi gönderme
Aşağıdaki kodu kullanıcı uygulamanıza üye olduğunda, üye girişi yaptığında ve uygulama ilk açılırken çalıştırın.
Code Block |
---|
Euromsg.setEmail(email: "test@relateddigital.com", permission: true) Euromsg.setEuroUserId(userKey: "1234567890") Euromsg.sync() |
Mobil kanaldan gelen datalarınızın RMC'ye yüklenebilmesi için, aktif RMC hesabınızda kullanmış olduğunuz referans değeriniz ne ise (KEY_ID* veya E-Mail vb.) mobil kanaldan gelen dataların da bu referans ile gelmesine dikkat ediniz."
*KEY_ID: Uygulama sahibi tarafından müşterisinin tekilleştirilmesi için kullanılan id değerleridir. Bunlar CRM id, userid, customerid, accountid gibi farklı isimlerle ifade ediliyor olabilir.
...
.
...
IYS E-Posta Kaydı
IYS kodunu Euromsg.sync() kodundan hemen önce ekleyiniz.
...