tinycreative / react-native-intercom

React Native wrapper for Intercom.io
MIT License
407 stars 280 forks source link

Intercom 10 on iOS #457

Closed nabilfreeman closed 2 years ago

nabilfreeman commented 2 years ago

Intercom 10 has come out with a lot of help center improvements. There are some new methods such as displaying a Help Center sub-category which would be interesting to have in the project.

The only breaking change is hideMessenger has been renamed to hideIntercom.

Can I open a PR to update to v10 in the podspec and fix the breaking change?

nabilfreeman commented 2 years ago

In the meantime, here is a patch:

react-native-intercom+21.1.0.patch

diff --git a/node_modules/react-native-intercom/iOS/IntercomWrapper.m b/node_modules/react-native-intercom/iOS/IntercomWrapper.m
index a0fcd7d..c84c9fd 100644
--- a/node_modules/react-native-intercom/iOS/IntercomWrapper.m
+++ b/node_modules/react-native-intercom/iOS/IntercomWrapper.m
@@ -134,7 +134,7 @@ RCT_EXPORT_METHOD(hideMessenger :(RCTPromiseResolveBlock)resolve :(RCTPromiseRej
     NSLog(@"hideMessenger");

     dispatch_async(dispatch_get_main_queue(), ^{
-        [Intercom hideMessenger];
+        [Intercom hideIntercom];
     });

     resolve([NSNull null]);
diff --git a/node_modules/react-native-intercom/react-native-intercom.podspec b/node_modules/react-native-intercom/react-native-intercom.podspec
index 0f39a33..0294cda 100644
--- a/node_modules/react-native-intercom/react-native-intercom.podspec
+++ b/node_modules/react-native-intercom/react-native-intercom.podspec
@@ -15,5 +15,5 @@ Pod::Spec.new do |s|
   s.frameworks   = [ "Intercom" ]
   s.static_framework = true
   s.dependency 'React'
-  s.dependency 'Intercom', '~> 9.3.6'
+  s.dependency 'Intercom', '~> 10'
 end
\ No newline at end of file
nabilfreeman commented 2 years ago

@browniefed tagging you as I believe you are a maintainer 😇

browniefed commented 2 years ago

Open a PR I will accept it

nabilfreeman commented 2 years ago

Great thank you!!!

nabilfreeman commented 2 years ago

@browniefed I opened a PR here: https://github.com/tinycreative/react-native-intercom/pull/458

Unless you have any objections I would like to work on 2 other PRs: 1) Intercom 10 on Android 2) displayHelpCenterCollection method which accepts a collection ID and displays a subset of Help Center https://developers.intercom.com/installing-intercom/docs/ios-help-center

We actively use react-native-intercom on a large production app (@lesalonapp) so happy to dedicate some dev resources to keeping this going.

browniefed commented 2 years ago

@nabilfreeman great, I will accept and publish as necessary. Just tag me otherwise I have notifications turned off.

Intercom themselves was supposed to take over and release their own library in July, that has not seemingly happened? I am not sure.

nabilfreeman commented 2 years ago

Oh!! You are right, they have. Thanks for letting me know. I'll try that out before I work on any more patches here.

https://github.com/intercom/intercom-react-native

Times change... I'll miss this library. Been a big help for my startups over the years 🚀