In-App Message
In-App Messages, doğrudan mobil uygulamanızda etkin olduklarında kullanıcılarınıza gösterilen bildirimlerdir. In-App Message özelliğini etkinleştirmek için createAPI'yi çağırırken inAppNotificationsEnabled parametresinin değerini ayarlamanız gerekir.
import VisilabsIOS func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { Visilabs.createAPI(organizationId: "YOUR_ORGANIZATION_ID", profileId: "YOUR_PROFILE_ID" , dataSource: "YOUR_DATASOURCE", inAppNotificationsEnabled: true, channel: "IOS" , requestTimeoutInSeconds: 30, geofenceEnabled: false, maxGeofenceCount: 20) return true }
Her customEvent çağrısından sonra In-App Message olup olmadığı kontrol edilir. RMC yönetim panelinin https://intelligence.relateddigital.com/#Target/TargetingAction/TAList sayfasında In-App Message oluşturabilir ve özelleştirebilirsiniz.
8 farklı In-App Message tasarımı mevcut:
Pop-up - Görsel, Başlık, Yazı & Buton | Mini - İkon & Yazı | Tam Ekran Görsel |
Tam Ekran Görsel ve Buton | Pop-up - Görsel, Başlık, Yazı ve Buton | Pop-up Anket |
Pop-up - Yazı ve Butonlu NPS | Native Alert & Action Sheet | |
Favori Özellikler Aksiyonu
RMC panelindeki https://intelligence.relateddigital.com/#Target/TargetingAction/TAList/ bölümünden tanımladığınız Favori Özellik Aksiyonu türündeki Target Aksiyonu favori özelliklerine aşağıdaki gibi mobil uygulama üzerinden erişebilirsiniz.
Visilabs.callAPI().getFavoriteAttributeActions { (response) in if let error = response.error { print(error) } else { if let favoriteBrands = response.favorites[.brand] { for brand in favoriteBrands { print(brand) } } if let favoriteCategories = response.favorites[.category] { for category in favoriteCategories { print(category) } } } }
Target Aksiyonun ID’sini belirterekte favori özellik aksiyonunun özelliklerine erişebilirsiniz.
Visilabs.callAPI().getFavoriteAttributeActions(actionId: 188) { (response) in if let error = response.error { print(error) } else { if let favoriteBrands = response.favorites[.brand] { for brand in favoriteBrands { print(brand) } } if let favoriteCategories = response.favorites[.category] { for category in favoriteCategories { print(category) } } } }
Favori Özellikler Aksiyonu enum olarak aşağıdaki değerleri döner.
public enum VisilabsFavoriteAttribute: String { case ageGroup case attr1 case attr2 case attr3 case attr4 case attr5 case attr6 case attr7 case attr8 case attr9 case attr10 case brand case category case color case gender case material case title }
Hikaye Aksiyonu
Hikaye Aksiyonu, iOS cihazlarınızda “Instagram Hikayeler” benzer şekilde widget eklemenize olanak sağlar. getStoryView metodu, UIView altsınıfı olan VisilabsStoryHomeView örneğini döndürür.
let storyView = Visilabs.callAPI().getStoryView() view.addSubview(storyHomeView)
Ayrıca Target Aksiyonu ID’sine göre de istediğiniz bir Hikaye Aksiyonunu çağırabilirsiniz.
let storyView = Visilabs.callAPI().getStoryView(actionId: 67) view.addSubview(storyHomeView)
Mail Üyelik Formu
RMC panelden in-app message’da olduğu gibi mail üyelik formunu oluşturduktan sonra her customEvent çağırdığınız zaman mail üyelik formu olup olmadığı kontrol edilir ardından mail üyelik formu gösterilir.
Geofencing
Uygulamanızda konum hizmetlerini etkinleştirmek için öncelikle aşağıdaki anahtarları Info.plist dosyanıza eklemeniz gerekir.
NSLocationAlwaysAndWhenInUseUsageDescription
NSLocationWhenInUseUsageDescription
Bu izinlerin örnek uygulaması aşağıdaki gibidir:
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key> <string>We need access to your location for better user experience.</string> <key>NSLocationWhenInUseUsageDescription</key> <string>We need access to your location for better user experience.</string>
Ayrıca bölgeleri izlemek, bölge listesini yenilemek ve push bildirimlerini almak için Info.plist dosyanızda UIBackgroundModes altına aşağıdaki anahtarları eklemeniz gerekir.
<array> <string>fetch</string> <string>location</string> <string>remote-notification</string> </array>
Visilabs SDK'yı başlatırken createAPI yönteminin geofenceEnabled parametresini true olarak ayarlamanız gerekir. Ayrıca maxGeofenceCount değerini 20'den daha düşük bir değerle değiştirebilirsiniz. Apple, herhangi bir uygulamanın aynı anda 20'den fazla bölgeyi izlemesini engeller. Visilabs tüm bu yuvaları kullanabilir.
import VisilabsIOS func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { Visilabs.createAPI(organizationId: "YOUR_ORGANIZATION_ID", profileId: "YOUR_PROFILE_ID" , dataSource: "YOUR_DATASOURCE", inAppNotificationsEnabled: false, channel: "IOS" , requestTimeoutInSeconds: 30, geofenceEnabled: true, maxGeofenceCount: 20) return true }
Recommendation
Ürün önerileri, SDK’nın recommend metoduyla elde edilir. Ürün önerilerini almak için zoneId, productCode ve complete olan 3 zorunlu argümanı iletmelisiniz.
completion parametresi, bir VisilabsRecommendationResponse örneğini girdi olarak alan ve hiçbir şey döndürmeyen bir kapatma ifadesidir. VisilabsRecommendationResponse'un yapısı aşağıda gösterilmiştir:
public class VisilabsRecommendationResponse { public var products: [VisilabsProduct] public var error: VisilabsError? internal init(products: [VisilabsProduct], error: VisilabsError? = nil) { self.products = products self.error = error } }
VisilabsProduct
sınıfı aşağıdaki özelliklere bakar:
Property | Type |
---|---|
code | String |
title | String |
img | String |
dest_url | String |
brand | String |
price | Double |
dprice | Double |
cur | String |
dcur | String |
freeshipping | Bool |
samedayshipping | Bool |
rating | Int |
comment | Int |
discount | Double |
attr1 | String |
attr2 | String |
attr3 | String |
attr4 | String |
attr5 | String |
Completion yönteminde verilen argümanlar için önerilen ürünler mevcutsa, ürün dizisini işlemeniz gerekir.
Visilabs.callAPI().recommend(zoneID: "6", productCode: "pc", filters: []){ response in if let error = response.error { print(error) }else{ print("Recommended Products") for product in response.products{ print("product code: \(product.code) title: \(product.title)") } } }
Recommend metodu için bir dizi filtre de iletebilirsiniz. Örneğin, aşağıdaki uygulama yalnızca başlıkta laptop içeren ürünleri döndürür.
var filters = [VisilabsRecommendationFilter]() let filter = VisilabsRecommendationFilter(attribute: .title, filterType: .like, value: "laptop") filters.append(filter) Visilabs.callAPI().recommend(zoneID: "6", productCode: "pc", filters: filters){ response in if let error = response.error{ print(error) }else{ print("Recommended Products") for product in response.products{ print("product code: \(product.code) title: \(product.title)") } } }