Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MOEN-33174: Cards fetch on login #130

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ extension MoEngageCardsSyncEventType {
return MoEngageFlutterCardsConstants.NativeToFlutterMethods.pullToRefreshCardsSync
case .inboxOpen:
return MoEngageFlutterCardsConstants.NativeToFlutterMethods.inboxOpenCardsSync
case .appOpen:
return MoEngageFlutterCardsConstants.NativeToFlutterMethods.appOpenCardsSync
case .appOpen,
.immediate:
return MoEngageFlutterCardsConstants.NativeToFlutterMethods.cardGenericSync
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ public class MoEngageCardsPlugin: NSObject, FlutterPlugin {
}
case MoEngageFlutterCardsConstants.FlutterToNativeMethods.onCardSectionLoaded:
pluginHelper.onCardsSectionLoaded(payload)
case MoEngageFlutterCardsConstants.FlutterToNativeMethods.setAppOpenCardsSyncListener:
pluginHelper.setAppOpenSyncListener(payload)
case MoEngageFlutterCardsConstants.FlutterToNativeMethods.cardGenericSync:
pluginHelper.setSyncListener(payload)
case MoEngageFlutterCardsConstants.FlutterToNativeMethods.onCardSectionUnloaded:
pluginHelper.onCardsSectionUnLoaded(payload)
case MoEngageFlutterCardsConstants.FlutterToNativeMethods.getCardsCategories:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ enum MoEngageFlutterCardsConstants {
static let refreshCards = "refreshCards"
static let fetchCards = "fetchCards"
static let onCardSectionLoaded = "onCardSectionLoaded"
static let setAppOpenCardsSyncListener = "setAppOpenCardsSyncListener"
static let cardGenericSync = "setSyncCompleteListener"
static let onCardSectionUnloaded = "onCardSectionUnLoaded"
static let getCardsCategories = "getCardsCategories"
static let cardsInfo = "getCardsInfo"
Expand All @@ -32,6 +32,6 @@ enum MoEngageFlutterCardsConstants {
enum NativeToFlutterMethods {
static let inboxOpenCardsSync = "onInboxOpenCardsSync"
static let pullToRefreshCardsSync = "onPullToRefreshCardsSync"
static let appOpenCardsSync = "onAppOpenCardsSync"
static let cardGenericSync = "onCardsSync"
}
}
4 changes: 2 additions & 2 deletions cards/moengage_cards_ios/lib/moengage_cards_ios.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ class MoEngageCardsIOS extends MoEngageCardsPlatform {
@override
void setSyncCompleteListener(
CardsSyncListener cardsSyncListener,
String appId,
String appId
) {
super.setSyncCompleteListener(cardsSyncListener, appId);
methodChannel.invokeMethod(
methodSetAppOpenCardsSyncListener,
methodSetCardsSyncListener,
getAccountMeta(appId),
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ abstract class MoEngageCardsPlatformInterface extends PlatformInterface {
/// [appId] - MoEngage App ID
void setSyncCompleteListener(
CardsSyncListener cardsSyncListener,
String appId,
String appId
) =>
throw UnimplementedError();
}
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const String methodInitialize = 'initialize';
const String methodRefreshCards = 'refreshCards';
const String methodFetchCards = 'fetchCards';
const String methodOnCardSectionLoaded = 'onCardSectionLoaded';
const String methodSetAppOpenCardsSyncListener = 'setAppOpenCardsSyncListener';
const String methodSetCardsSyncListener = 'setSyncCompleteListener';
const String methodOnCardSectionUnLoaded = 'onCardSectionUnLoaded';
const String methodCardsCategories = 'getCardsCategories';
const String methodCardsInfo = 'getCardsInfo';
Expand Down