Skip to content

Commit

Permalink
MOEN-33174: Cards fetch on login iOS(#130)
Browse files Browse the repository at this point in the history
  • Loading branch information
RakshithaAcharya authored Jul 17, 2024
1 parent 9b05c6c commit 8dfefdf
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
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"
}
}
5 changes: 2 additions & 3 deletions cards/moengage_cards_ios/lib/moengage_cards_ios.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,10 @@ class MoEngageCardsIOS extends MoEngageCardsPlatform {
}

@override
void setSyncCompleteListener(
CardsSyncListener cardsSyncListener, String appId) {
void setSyncCompleteListener(CardsSyncListener cardsSyncListener, 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 @@ -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

0 comments on commit 8dfefdf

Please sign in to comment.