Comments (6)
Hi @ldiqual,
Here is our orientation-related code for in-app message:
The default values for the supportedOrientations
and supportedOrientationMasks
are
_supportedOrientations = UIInterfaceOrientationPortrait | UIInterfaceOrientationLandscapeRight |
UIInterfaceOrientationLandscapeLeft | UIInterfaceOrientationPortraitUpsideDown;
_supportedOrientationMasks = UIInterfaceOrientationMaskAll;
In the in-app message's view controller:
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
return self.supportedOrientations;
}
- (NSUInteger)supportedInterfaceOrientations {
return self.supportedOrientationMasks;
}
- (BOOL)shouldAutorotate {
return YES;
}
Please note that for the method supportedInterfaceOrientations
, the return type should be UIInterfaceOrientationMask
; we will update our code. But given that UIInterfaceOrientationMask
is NSUInteger according to Apple's documentation, I don't think that is the reason for the crash.
Could you give us more information about how you use in-app message? Do you set the supportedOrientations
and/or supportedOrientationMasks
of ABKInAppMessageController
? What are the steps to reproduce the crash?
Please let me know if you want any more information about code in Appboy.
Thanks,
Wenzhi
from appboy-ios-sdk.
@Wenzhi Thanks for the followup.
But given that UIInterfaceOrientationMask is NSUInteger according to Apple's documentation, I don't think that is the reason for the crash.
Agreed, that shouldn't matter here.
Could you give us more information about how you use in-app message? Do you set the supportedOrientations and/or supportedOrientationMasks of ABKInAppMessageController?
We don't do anything else other than integrating with segment with the Appboy integration enabled (using Segment-Appboy). We don't set supportedOrientations
and co in ABKInAppMessageController. We do have a subclass of ABKFeedViewControllerModalContext
(which also doesn't set supportedOrientations
) but I believe it is unrelated.
What are the steps to reproduce the crash?
This is where it gets tough. We don't know for sure that it is due to Appboy inapp notifications, however:
- The crash started appearing in a version where the only change was adding Appboy (via segment, and in a newsfeed tab)
- Disabling inapp notifications on the server-side solved the issue for some of our users (after uninstalling the app, which I assume clears the inapp notification cache)
- The only occurrence of
preferredInterfaceOrientationForPresentation
in our entire workspace is inABKInAppMessageController.h
- We reached out to one of our users and asked which orientation they were holding their phone when they started the app, it was landscape (while we support only portrait).
However there is no reference to Appboy in the stacktrace (which is not surprising, it's probably showing a view controller and that call is on the next runloop event). We also can't reproduce the crash (by sending inapp modals to our devices by holding our device in landscape mode).
Would you recommend setting the supported orientation modes manually? Also, why does your documentation indicate "In-app messages will normally support the orientations specified in the app settings" while it seems that they are hardcoded?
from appboy-ios-sdk.
Hi @ldiqual,
About Your Question
why does your documentation indicate "In-app messages will normally support the orientations specified in the app settings" while it seems that they are hardcoded?
Our in-app messages follow the app's orientation settings, even with the default values which support all orientations. Per Apple's supportedInterfaceOrientations
documentation:
The system intersects the view controller's supported orientations with the app's supported orientations (as determined by the Info.plist file or the app delegate's application:supportedInterfaceOrientationsForWindow: method) to determine whether to rotate.
And In preferredInterfaceOrientationForPresentation
:
When your view controller supports two or more orientations but the content appears best in one of those orientations, override this method and return the preferred orientation.
Regarding setting the orientation modes manually, it shouldn't make a difference in your case (IAMs will only ever show in portrait). That said, absent any other strong leads at this point, you might try setting that value.
About The Issue
Also - we display an in-app message with a UIWindow on top of the app's window and remove it after the in-app message is dismissed. Are you using any customized UIWIndow, too?
It's also possible this is a Swift-only issue. We'll investigate that avenue further.
Finally, if you have any information about the Devices/OSes that you're seeing this on, any info there would be useful.
Please let me know if you get more information about the crash, and/or if you have any follow-up comments/questions.
Thanks,
Wenzhi
from appboy-ios-sdk.
Hey @Wenzhi,
That said, absent any other strong leads at this point, you might try setting that value.
Will do this in our next version and report back.
Are you using any customized UIWIndow, too?
We're using a couple libraries that might use their own UIWindow to display content:
I'll take a look at their source code to see if there's something wrong there.
Finally, if you have any information about the Devices/OSes that you're seeing this on, any info there would be useful.
Our 3 affected users:
Full stacktrace:
Thanks for tackling this. I'll get back to you if we find more info on this.
from appboy-ios-sdk.
Doesn't seem to be happening in our new version. Closing for now.
from appboy-ios-sdk.
Hi
We have a crash on In-App messaging for large number of users related to preferredInterfaceOrientationForPresentation.
Fatal Exception: UIApplicationInvalidInterfaceOrientation
preferredInterfaceOrientationForPresentation '(7)' must match a supported interface orientation: 'portrait, landscapeLeft, landscapeRight, portraitUpsideDown'!
-[UIViewController _preferredInterfaceOrientationForPresentationInWindow:fromInterfaceOrientation:]
Our app supports only Portrait and mentioned in the info.plist as “UIInterfaceOrientationPortrait” under UISupportedInterfaceOrientations
I managed to reproduce the issue and explained below
- Received In-app message on our app
- Pressed home button without doing any action In-App
- Opened the app again, then it crashed.
When I debugged, I found that “preferredInterfaceOrientationForPresentation” function of “ABKInAppMessageWindowController” class returns unsupported interface orientation type on resuming the app from background
PS: We are using Appboy version 3.3.1
from appboy-ios-sdk.
Related Issues (20)
- [Feature]: Modal In-app message could be dismissed also by tapping on blurred background HOT 2
- Test Issue
- [Bug]: Appboy-iOS-SDK 4.4.3 + not Archiving with Bitrise HOT 3
- [Bug]: Appboy ios SDK 4.4.4 archive failed HOT 4
- [Bug]: Blank UIWindow when IAM received HOT 2
- [Feature]: Need Asynchronous callback when dispatch to server is completed HOT 6
- [Bug]: Geofence not working at all HOT 2
- [Bug]: Previews not working on Xcode 14.X HOT 6
- [Bug]: ABKUIUtils.activeWindowScene sometimes is wrong HOT 3
- [Bug]: Background Task will cause a risk of termination from [ABKService processRequest:] HOT 4
- [Bug]: Appboy 4.5.2 has been crashed when try to use method "logPurchse:" HOT 8
- [Bug]: UI unresponsiveness if invoked on the main thread HOT 3
- [Feature]: methods for handling `brazeAction` uri's HOT 1
- [Bug]: Push notification received after `Appboy.disableSDK` HOT 4
- [Feature]: HOT 2
- [Bug]: SDWebImage dependency. HOT 1
- [Bug]: ABKCustomPropertyUtils validateArray HOT 6
- [Bug]: From 4.2.0 to 4.5.4, deviceToken registration fails. No push dialog box is displayed HOT 9
- [Feature]: Upgrade SDWebImage to latest HOT 6
- [Bug]: 0x1b4ea62b8 __CFBinaryPlistWriteOrPresize + 556 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from appboy-ios-sdk.