Versions Compared

Key

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

GitHub

İncele

pub.dev

İncele

Gereklilikler

  • iOS 10.0 veya üzeri

  • Android API level 21 veya üzeri

Kurulum

  • Projenizin pubspec.yaml dosyasını alttaki şekilde güncelleyin

    Code Block
    languageyaml
    dependencies:
        relateddigital_flutter: ^0.1.0

  • flutter pub get komutunu çalıştırın

  • Paketi içeri aktarın

    Code Block
    languagedart
    import 'package:relateddigital_flutter/relateddigital_flutter.dart';

Platform Entegrasyonları

Android

  • project/build.gradle dosyanızdaki iki repositories bölümüne alttaki satırı ekleyin.

    Code Block
    maven {url 'http://developer.huawei.com/repo/'} // skip if your app does not support HMS

  • project/build.gradle dosyanızdaki dependencies bölümüne alttaki satırları ekleyin.

    Code Block
    languagenone
    classpath 'com.google.gms:google-services:4.3.5'
    classpath 'com.huawei.agconnect:agcp:1.4.1.300' // skip if your app does not support HMS

  • app/build.gradle dosyanızın en altına alttaki satırları ekleyin.

    Code Block
    apply plugin: 'com.google.gms.google-services'
    apply plugin: 'com.huawei.agconnect' // skip if your app does not support HMS

  • app/build.gradle dosyanızın defaultConfig alanındaki minSdkVersion değerini 21 olarak düzenleyin.

  • AndroidManifest.xml dosyanızın <application></application> etiketleri arasına alttaki satırları ekleyin.

    Code Block
    languagexml
    <service
       android:name="euromsg.com.euromobileandroid.service.EuroFirebaseMessagingService"
       android:exported="false">
       <intent-filter>
           <action android:name="com.google.firebase.MESSAGING_EVENT" />
       </intent-filter>
    </service>
    
    <!-- skip if your app does not support HMS  -->
    <service
       android:name="euromsg.com.euromobileandroid.service.EuroHuaweiMessagingService"
       android:exported="false">
       <intent-filter>
           <action android:name="com.huawei.push.action.MESSAGING_EVENT" />
       </intent-filter>
    </service>

  • Firebase panelinden alacağınız google-services.json dosyasını projenizin android/app dizinine ekleyin.

  • Uygulamanızda HMS desteği varsa agconnect-services.json dosyasını android/app dizinine ekleyin.

iOS

  • Podfile dosyanızdaki ios platform versiyonunu 10.0 veya üzeri olarak değiştirin.

    Code Block
    platform :ios, '10.0'

  • Proje dizininizde ios/Runner.xcworkspace dosyasını Xcode ile açın.

  • Signing & Capabilities sekmesinden Push Notifications ve Background Modes->Remote Notifications özelliklerini etkinleştirin.

    xcode-push-capability.png

Kullanım

Başlatma

  • Kütüphaneyi sayfaya ekleyin.

    Code Block
    languagedart
    import 'package:relateddigital_flutter/relateddigital_flutter.dart';
    import 'package:relateddigital_flutter/request_models.dart';
    import 'package:relateddigital_flutter/response_models.dart';

  • Alttaki şekilde konfigürasyonları tamamlayın. organizationId,siteId,dataSource,appAlias gibi parametrelerin değerleri için RMC ekibiyle iletişime geçin.

    Code Block
    languagedart
    final RelateddigitalFlutter relatedDigitalPlugin = RelateddigitalFlutter();
    
    @override
    void initState() {
      super.initState();
      initLib();
    }
    
    Future<void> initLib() async {
      var initRequest = RDInitRequestModel(
        appAlias: Platform.isIOS ? 'ios-alias' : 'android-alias',
        huaweiAppAlias: 'huawei-alias', // pass empty String if your app does not support HMS
        androidPushIntent: 'com.test.MainActivity', // Android only
        organizationId: 'ORG_ID',
        siteId: 'SITE_ID',
        dataSource: 'DATA_SOURCE',
        maxGeofenceCount: 20,  // iOS only
        geofenceEnabled: true,
        inAppNotificationsEnabled: true, // iOS only
        logEnabled: true,
      );
    
      await relatedDigitalPlugin.init(initRequest);
    }