react-nativecocoapodsonesignalpodfilereact-native-onesignal

How do I specify the version of react-native-onesignal in my podfile?


I'm following this guide on how to set up OneSignal with React Native. In the section where it says In your Podfile, add the notification service extension..., it says to add the following to my Podfile:

target 'OneSignalNotificationServiceExtension' do
  pod 'OneSignal', '>= 2.9.3', '< 3.0'
end

I think this is outdated though, because my version of react-native-onesignal is 3.7.2. How should I change this line in my Podfile to accommodate this newer version?


Solution

  • You haven’t specified which version range you think is appropriate instead, but if this Pod follows the common convention where breaking changes only happen when the major version changes, then you would use the constraints

    target 'OneSignalNotificationServiceExtension' do
      pod 'OneSignal', '>= 3.7.2', '< 4.0'
    end