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
[Bug]: iOS 13 crashes after receiving In-App Message #239
Comments
Hi @richardscheid, Thanks for raising this and providing the context. There appears not to be any Braze code based on the stack trace you provided. Could this crash be related to other parts of your code? |
Hey Daniel, Yes, I've considered that, but as the issue only happens after the IAM is shown, I thought to come here first. Also, In-App Browser stops working after the IAM as well (stays inactive, no crashes). So, I have two different libraries facing issues. None of these issues happens with iOS 14 and above. Could it be a compatibility issue? react-native-inappbrowser-reborn: 3.7.0 |
Hi @richardscheid, I see, it also appears that you are using a few other libraries that you mentioned which may also be related to this incompatibility:
Can you contact support@braze.com with more info:
Thanks! |
Hi @hokstuff, Thanks, I'll contact the support team.
It's happening to all campaigns.
This was a great suggestion and the issue persists with the native implementation (ActionSheetIOS). Same stack trace. |
Hi @richardscheid, just wanted to check in on this issue. Are you still experiencing this/were you able to get additional assistance from our support team? |
Which Platforms?
iOS
Which React Native Version?
0.71.14
Which @braze/react-native-sdk SDK version?
8.0.0
Repro Rate
100% of the time
Steps To Reproduce
If the IAM is not sent, the action sheet works as expected. Or, if I close the app and open it again, the action sheet works again.
Expected Behavior
As for iOS 14 and above, the user should be able to keep using the action sheet after receiving the IAM.
Actual Incorrect Behavior
After receiving IAM, the app crashes when attempting to open an action sheet.
Verbose Logs
Additional Information
#import "AppDelegate.h"
#import <React/RCTBundleURLProvider.h>
#import <React/RCTLinkingManager.h>
#import <UserNotifications/UserNotifications.h>
#import <RNCPushNotificationIOS.h>
#import <IntercomModule.h>
#import "Firebase.h"
#import "Orientation.h"
#import "AppsFlyerLib/AppsFlyerLib.h"
#import <BrazeKit/BrazeKit-Swift.h>
#import "BrazeReactBridge.h"
@implementation AppDelegate
static NSString *const brazeApiKey = @"...";
static NSString *const brazeEndpoint = @"...";
(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[FIRApp configure];
self.moduleName = @"...";
self.initialProps = @{};
BRZConfiguration *configuration = [[BRZConfiguration alloc] initWithApiKey:brazeApiKey endpoint:brazeEndpoint];
configuration.logger.level = BRZLoggerLevelInfo;
Braze *braze = [BrazeReactBridge initBraze:configuration];
AppDelegate.braze = braze;
[IntercomModule initialize:@"..." withAppId:@"..."];
UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
center.delegate = self;
if (@available(iOS 14, *)) {
UIDatePicker *picker = [UIDatePicker appearance];
picker.preferredDatePickerStyle = UIDatePickerStyleWheels;
}
return [super application:application didFinishLaunchingWithOptions:launchOptions];
}
#pragma mark - AppDelegate.braze
static Braze *_braze = nil;
(Braze *)braze {
return _braze;
}
(void)setBraze:(Braze *)braze {
_braze = braze;
}
// Required to register for notifications
{
[RNCPushNotificationIOS didRegisterUserNotificationSettings:notificationSettings];
}
// Required for the register event.
{
[IntercomModule setDeviceToken:deviceToken];
[AppDelegate.braze.notifications registerDeviceToken:deviceToken];
// notify AppsFlyerLib
[[AppsFlyerLib shared] registerUninstall:deviceToken];
[RNCPushNotificationIOS didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
}
// Required for the notification event. You must call the completion handler after handling the remote notification.
fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
{
[RNCPushNotificationIOS didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];
(void)[AppDelegate.braze.notifications handleBackgroundNotificationWithUserInfo:userInfo
fetchCompletionHandler:completionHandler];
}
// Required for the registrationError event.
{
[RNCPushNotificationIOS didFailToRegisterForRemoteNotificationsWithError:error];
}
// IOS 10+ Required for localNotification event
(void)userNotificationCenter:(UNUserNotificationCenter *)center
didReceiveNotificationResponse:(UNNotificationResponse *)response
withCompletionHandler:(void (^)(void))completionHandler
{
[RNCPushNotificationIOS didReceiveNotificationResponse:response];
(void)[AppDelegate.braze.notifications handleUserNotificationWithResponse:response
withCompletionHandler:completionHandler];
completionHandler();
}
// IOS 4-10 Required for the localNotification event.
(void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification
{
[RNCPushNotificationIOS didReceiveLocalNotification:notification];
}
(UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
return [Orientation getOrientation];
}
//Called when a notification is delivered to a foreground app.
-(void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler
{
completionHandler(UNAuthorizationOptionSound | UNAuthorizationOptionAlert | UNAuthorizationOptionBadge);
}
{
#if DEBUG
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
#else
return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
#endif
}
#if RCT_DEV
(BOOL)bridge:(RCTBridge *)bridge didNotFindModule:(NSString *)moduleName {
return YES;
}
#endif
(BOOL)application:(UIApplication *)app openURL:(NSURL *)url
options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options
{
return [RCTLinkingManager application:app openURL:url options:options];
}
(BOOL)concurrentRootEnabled
{
return true;
}
@EnD
The text was updated successfully, but these errors were encountered: