rees46_sdk 0.2.0
rees46_sdk: ^0.2.0 copied to clipboard
Flutter plugin wrapping the REES46 native personalization SDKs for Android and iOS.
rees46_flutter_sdk #
Flutter plugin wrapper around REES46 native SDKs (Android/iOS).
Getting Started #
Install #
Add dependency in your app:
dependencies:
rees46_sdk: ^0.0.1
Initialize #
import 'package:rees46_sdk/rees46_sdk.dart';
final sdk = PersonalizationSdk();
await sdk.initialize(
const SdkInitConfig(
shopId: 'YOUR_SHOP_ID',
apiDomain: 'api.rees46.ru',
// stream defaults to 'ios' on iOS and 'android' on Android if omitted.
stream: 'ios',
enableLogs: false,
autoSendPushToken: true,
sendAdvertisingId: false,
enableAutoPopupPresentation: true,
needReInitialization: false,
),
);
API structure #
The public API is exported from
package:rees46_sdk/rees46_sdk.dart:
PersonalizationSdk— the SDK entrypoint (tracking, search, recommendations, profile).SdkInitConfig— initialization config passed toinitialize().
Run demo app #
cd example
fvm flutter run
Notes #
- Android: uses Maven dependency
com.rees46:rees46-sdk:2.28.0and callsSDK.initialize(...). Some iOS-only init flags are accepted by Dart API but ignored on Android. - iOS: uses CocoaPods dependency
REES46 (3.23.0)and callscreatePersonalizationSDK(...). - Pushes:
- Android: when
autoSendPushToken=true, the native SDK fetches the FCM token viaFirebaseMessaging.getInstance().tokenduring initialization and sends it. - iOS: when
autoSendPushToken=true, the native SDK requests notification permission and registers for remote notifications. The Flutter plugin also forwardsdidRegisterForRemoteNotificationsWithDeviceTokenanddidReceiveRemoteNotificationAppDelegate callbacks to the native SDK.
- Android: when
Android push notification icon #
On Android the plugin displays incoming pushes itself, so the notification's small icon is resolved from the host app, never from REES46. You should point it at your own icon:
<!-- android/app/src/main/AndroidManifest.xml, inside <application> -->
<meta-data
android:name="com.rees46.push.notification_icon"
android:resource="@drawable/ic_stat_notify" />
The icon must be a white, alpha-only silhouette — Android tints the small icon, so a full-colour image renders as a solid white/grey square. Generate one via Android Studio → New → Image Asset → Notification Icons.
Already using Firebase? If your app already declares com.google.firebase.messaging.default_notification_icon, you don't need to set anything — the plugin reuses that icon. Set com.rees46.push.notification_icon only if you want a different icon for REES46 pushes specifically.
Resolution order:
- The
com.rees46.push.notification_iconmeta-data icon above (recommended if you want a dedicated icon). - The existing Firebase
com.google.firebase.messaging.default_notification_icon, if declared. - The app's launcher icon, if neither is set (may look like a square, since a launcher icon is not a silhouette).
- A neutral non-branded default bundled in the plugin, only if the host has no icon at all.
For Flutter plugin development basics, see Flutter docs: develop plugins.