Answered

iOS SDK: Crash occurs when Intercom opens a deep link from Messenger


iOS SDK 10.0.3 (also reproduced in all next SDK versions), iOS 14+

I send a message that includes a deep link associated with app. The deep link opens normally by click on Intercom message notification, but I receive a crash when click the link on Intercom Messenger:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[ICMPostViewController presentationContext]: unrecognized selector sent to instance 0x1194b6660'

The some rows from stack trace:

#6 0x00000001075cebc4 in -[ICMRootViewController closeIntercomModalWithCompletion:] at /Users/distiller/project/IntercomSDK/Classes/Presentation/Common/Windows/ICMRootViewController.m:368
 
#11 0x00000001873e2c98 in -[NSNotificationCenter postNotificationName:object:userInfo:] ()
 
#12 0x00000001075784b8 in +[ICMLinkOpener openCustomSchemeURL:] at /Users/distiller/project/IntercomSDK/Classes/Core/Link Handling/ICMLinkOpener.m:93

Could you help me to fix it?

 

Also I have a two different URL scheme for DEV and PROD applications. If I include two different URLs with both schemes, the Messenger opens a second (actually associated with another app) link, although the correct link does not open due to a crash. In other words, in development app associated with DEV schema URL causes crash, but PROD URL is opened in the production app. According to the documentation the PROD URL cannot be open:

"Linking to other apps is not supported with the iOS messenger. Your deep links must be for a scheme belonging to your app."

Is this behavior ok?

icon

Best answer by Brian B11 4 February 2022, 14:03

View original

15 replies

Userlevel 1

Hey @etaskun​, I'm going to open an issue with our engineers on this. Could I ask you to share the full stacktrace with me to help us diagnose this issue, please?

Hey Eric,

there are a stacktrace.

Userlevel 1

Thanks so much @etaskun​! I'll let you know as soon as I have an update.

Hi @eric f11​ ,

 

Is it possible to give any updates on how close you are to fixing this issue? I am currently migrating our app from react-native-intercom to @intercom/intercom-react-native and have run into this exact issue.

Userlevel 1

Hey @ben b11​, this issue is still open and I don't currently have any further updates to share.

Thanks for the quick response. 👍

Hi

I have the same critical issue. When tapping on Deeplink our app crashing.

I tried the latest Intercom lib 11.1.0 but the issue still occur and reproducible 100%.

 

Any news when it will be fixed?

 

libc++abi: terminating with uncaught exception of type NSException
dyld4 config: DYLD_ROOT_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot DYLD_LIBRARY_PATH=/Users/gena/Library/Developer/Xcode/DerivedData/Tonsser-hicchuuokirtbsdrxyqeuindtwqw/Build/Products/Dev-iphonesimulator:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libBacktraceRecording.dylib:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libMainThreadChecker.dylib:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib DYLD_FRAMEWORK_PATH=/Users/gena/Library/Developer/Xcode/DerivedData/Tonsser-hicchuuokirtbsdrxyqeuindtwqw/Build/Products/Dev-iphonesimulator:/Users/gena/Library/Developer/Xcode/DerivedData/Tonsser-hicchuuokirtbsdrxyqeuindtwqw/Build/Products/Dev-iphonesimulator/PackageFrameworks
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[ICMPostViewController presentationContext]: unrecognized selector sent to instance 0x7fa54e8a4d50'
terminating with uncaught exception of type NSException

 

Userlevel 2
Badge +2

Hi 👋

Thanks for your patience while we fixed this issue.

Its available in Release 11.1.2

Brian

Userlevel 1

@genry​ @ben b11​ @etaskun​ 

@eric f11​ Thanks so much for having this fixed!

 

The project I work on uses React Native. Are you planning to update the React Native wrapper to include v. 11.1.2 of the iOS SDK any time soon?

 

I have currently made the fix work with React Native by "manually" updating `node_modules/@intercom/intercom-react-native/intercom-react-native.podspec` to use 11.1.2 instead of 11.0.0, which seems to work all right, but probably isn't the ideal solution. However, if your update to the React Native wrapper is far away, then I might just be able to live with it.

Userlevel 1

Hey @ben b11​, this change should be shipped later this week 😄

Perfect! Thank you so much! 🙂

@brian b11@eric f11​ I can see on your GitHub releases page that you have released 2.0.2 of the React Native SDK 🎉 . However, it doesn't seem to have been published to Yarn. Did someone forget to do this as part of the release process?

Userlevel 2
Badge +2

@ben b11​ Thanks for the heads up. The final publish step failed.

Fixed now so 2.0.2 is available now https://www.npmjs.com/package/@intercom/intercom-react-native/p>

Perfect, thank you.

Reply