mobsur_flutter_sdk

Last updated:

0 purchases

mobsur_flutter_sdk Image
mobsur_flutter_sdk Images
Add to Cart

Description:

mobsur flutter sdk

MobSur Flutter SDK #
More information on https://mobsur.com
Usage #

Add this package as dependency in pubspec.yml

dependencies:
mobsur_flutter_sdk: ^1.0.4
copied to clipboard

Then run flutter pub get


Import it in your project

import 'package:mobsur_flutter_sdk/mobsur_flutter_sdk.dart';
copied to clipboard

Call the setup method.

void main() {
WidgetsFlutterBinding.ensureInitialized()

// You can call this method somewhere else in the app instead,
// but it should not be right before an event, that should trigger a survey
MobSurSDK().setup('YOUR-APP-ID', 'user-id');

runApp(const MyApp());
}
copied to clipboard

Call the event method, passing the build context.

MobSurSDK().logEvent('event-name-here', context);
copied to clipboard

If you do not know the client id during the setup, you can pass it later. The client id can't be empty string.

MobSurSDK().updateClientId('client-id-here');
copied to clipboard
Important!!! #
For the Android platform, we have minimum SDK version requirements.
If you need to use the app on lower version than 32, please contact us.
// android/app/build.gradle:
...
android {
compileSdkVersion 32 // or higher
...

defaultConfig {
...
minSdkVersion 32 // or higher
...
}
}

copied to clipboard
Recommendation #
Call the event method in a wrapper class that manages your events.
If you already have events in the app, it's a good idea to call the method for all the events and then, the correct one will be selected in the dashboard.

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.