在遵循网站上的指示之后,当我尝试在iOS上构建时,我得到了这个错误:
Thread 1: "Application tried to present modally a view controller <UIViewController: 0x7f90684afee0> that is already being presented by <UIViewController: 0x7f906847c320>."https://i.stack.imgur.com/7tUUE.png
Info.plist
<key>MoEngage</key>
<dict>
<key>MoEngage_APP_ID</key>
<string>...</string>
</dict>
...AppDelegate.m
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
...
// Set Data Center
[MoEngage setDataCenter:DATA_CENTER_01]; //DATA_CENTER_01, DATA_CENTER_02, OR DATA_CENTER_03
[[MOReactInitializer sharedInstance] intializeSDKWithLaunchOptions:launchOptions];
return YES;
}发布于 2021-11-22 07:20:06
我解决了问题,对我来说,这是因为文件AppDelegate中的两行放错了位置。确保这些:
[MoEngage setDataCenter:DATA_CENTER_01]; //DATA_CENTER_01, DATA_CENTER_02, OR DATA_CENTER_03
[[MOReactInitializer sharedInstance] intializeSDKWithLaunchOptions:launchOptions];是(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions函数的正确位置,在我的例子中,是将它们放在正确的前面:
RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
moduleName:@"finan"
initialProperties:nil];
rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];发布于 2021-11-22 06:13:55
MoEngageSDK只在RichLanding的情况下显示ViewController。上述错误指向
反应-本机-溅-屏
在[RNSplashScreen show];中调用AppDelegate插件。因此,问题似乎来自于react-native-splash-screen插件。
另外,对于另一个错误。你得确保
[[MOReactInitializer sharedInstance] intializeSDKWithLaunchOptions:launchOptions]正在被正确初始化。
此外,您还可以与moengage的支持团队进行检查,以便在https://help.moengage.com/上解决这一问题。
https://stackoverflow.com/questions/70029892
复制相似问题