Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

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
    }                                        
  • No labels