PPGInAppMessages class
PushPushGo In-App Messages SDK for Flutter
Use this class to display in-app messages in your Flutter app.
Example:
// Initialize in your app
await PPGInAppMessages.instance.initialize(
apiKey: 'your-api-key',
projectId: 'your-project-id',
);
// Notify route changes
PPGInAppMessages.instance.onRouteChanged('home');
// Show messages on custom triggers
PPGInAppMessages.instance.showMessagesOnTrigger(
key: 'purchase_completed',
value: 'product_123',
);
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isInitialized → bool
-
Check if SDK is initialized
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
bufferRoute(
String route) → void - Buffer a route change that occurred before initialization Called by NavigatorObserver when SDK is not yet initialized
-
clearMessageCache(
) → Future< void> - Clear the message cache
-
dispose(
) → void - Dispose resources (call when app is closing)
-
initialize(
{required String apiKey, required String projectId, bool isProduction = true, bool isDebug = false}) → Future< void> - Initialize the In-App Messages SDK
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onRouteChanged(
String route) → Future< void> - Notify the SDK about a route/screen change
-
setCustomCodeActionHandler(
CustomCodeActionHandler handler) → void - Set a handler for custom code actions
-
showMessagesOnTrigger(
{required String key, required String value}) → Future< void> - Show messages matching a custom trigger
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance → PPGInAppMessages
-
Singleton instance
final
-
Alternative getter for singleton (matches iOS/Android pattern)
no setter