-
Notifications
You must be signed in to change notification settings - Fork 7
Manual plugin integration for iOS (in case your dependencies do not support `use_frameworks!`)
Deprecated
: Starting from 6.2.0 plugin version you can integrate plugin without use_frameworks!
, check the migration guide.
Some Cocoapod dependencies may not support building as dynamic framework, it may arise following error with use_frameworks!
added to the Podfile, when you are doing pod install
:
[!] The 'Example' target has transitive dependencies that include statically linked binaries: ...
You can use Manual integration for iOS in this case.
- Carthage (brew install carthage), version upper 0.37.0
If previously MobileMessaging plugin was integrated automatically, following steps better to do before doing manual integration:
- cleanup pods -
cd ios & pod deintegrate & pod update
- cleanup Xcode derived data -
Product->Clean Build Folder
in Xcode and from Terminalrm -rf ~/Library/Developer/Xcode/DerivedData/*
- npm start --reset-cache
-
Disable autolinking for plugin - add
react-native.config.js
file or edit your current.module.exports = { dependencies: { 'infobip-mobile-messaging-react-native-plugin': { platforms: { ios: null, }, }, }, };
-
npm install infobip-mobile-messaging-react-native-plugin
-
Build MobileMessaging.framework
cd node_modules/infobip-mobile-messaging-react-native-plugin
npm run mm_build
-
Open your Main app targets'
General settings
tab in Xcode, scroll to theFrameworks, Libraries, and Embedded Content
section, drag and dropMobileMessaging.xcframework
from thenode_modules/infobip-mobile-messaging-react-native-plugin/ios/Carthage/Build
folder. In the "Embed" section, select "Embed and sign" from the pulldown menu.
- In the targets
Build Settings
tab add path"$(SRCROOT)/../node_modules/infobip-mobile-messaging-react-native-plugin/ios/Carthage/Build"
to theFramework Search Paths
. This needs to be done for Main app target and forMobileMessagingNotificationExtension
target as well.
- Drag and drop
node_modules/infobip-mobile-messaging-react-native-plugin/ios/MobileMessagingPlugin
folder to your project in xCode, chooseCopy items if needed
andCreate groups
options. Add files to your main application target.
- Add bridging header, if it's not exist - create
<MainTarget>-Bridging-Header.h
file and setup it asObjective-C Bridging Header
inBuild Settings
for you Main app target. Add it to bridging header:#import <React/RCTBridgeModule.h> #import <React/RCTEventEmitter.h> #import <React/RCTViewManager.h>
If you have any problems with creating Bridging Header, just create and add temporary .swift file to your project, xCode will automatically provide dialog with option "Create Bridging Header". After that you can delete this .swift file.
- c,d steps from Quick Start Guide->Configure Platforms->iOS
Integrating Notification Service Extension
-
Install and run our special Ruby Gem called "mmine" as described in the 1st step of Notification Service Extension setting up Xcode project instruction
-
Specify path to
MobileMessaging.xcframework
inFramework Search Path
forMobileMessagingNotificationExtension
target as described in the 5th step of Manual integration steps.
How to return back to normal integration, since starting from 6.2.0 plugin version it can be used without use_frameworks!
.
-
Enable back autolinking for plugin - remove
react-native.config.js
file or remove following from it.module.exports = { dependencies: { 'infobip-mobile-messaging-react-native-plugin': { platforms: { ios: null, }, }, }, };
-
Reinstall plugin
npm uninstall infobip-mobile-messaging-react-native-plugin && npm install infobip-mobile-messaging-react-native-plugin
-
Open your Main app targets'
General settings
tab in Xcode, scroll to theFrameworks, Libraries, and Embedded Content
section, removeMobileMessaging.xcframework
, repeat the same for the NotificationExtension target if applicable. -
In the targets
Build Settings
tab remove path"$(SRCROOT)/../node_modules/infobip-mobile-messaging-react-native-plugin/ios/Carthage/Build"
from theFramework Search Paths
. This needs to be done for Main app target and forMobileMessagingNotificationExtension
target as well. -
Remove group
MobileMessagingPlugin
with files inside it from your project in xCode -
From the ios folder perform
pod deintegrate && pod install
-
You can remove BridgingHeader file if you don't have other swift files in your project's main target.
-
In the
AppDelegate.m
file change@import MobileMessaging
to the#import <MobileMessaging/MobileMessagingPluginApplicationDelegate.h>
If you have any questions or suggestions, feel free to send an email to support@infobip.com or create an issue.
- Library events
- Server errors
- Users and installations
- Messages and notifications management
- Inbox
- Privacy settings
- In‐app chat
- WebRTC Calls and UI
- Migration guides