-
Notifications
You must be signed in to change notification settings - Fork 48
Add podspec to support iOS auto-linking in RN >=0.60 #20
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the podspec file needs to actually go in the root directory
and not in the ios folder.
ios/react-native-iot-wifi.podspec
Outdated
s.platform = :ios, "9.0" | ||
|
||
s.source = { :git => "https://github.com/tadasr/react-native-iot-wifi.git", :tag => "#{s.version}" } | ||
s.source_files = "ios/**/*.{h,m}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s.source_files = "ios/**/*.{h,m}" | |
s.source_files = "ios/**/*.{h,m}" | |
s.dependancy = "React" |
I've updated the Podspec location and added the dependency. |
@@ -0,0 +1,18 @@ | |||
require 'json' | |||
|
|||
package = JSON.parse(File.read(File.join(__dir__, '../package.json'))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since the file is now in the root directory
the reference for the package.json needs to be at the same level as the podspec file.
package = JSON.parse(File.read(File.join(__dir__, '../package.json'))) | |
package = JSON.parse(File.read(File.join(__dir__, './package.json'))) |
|
||
s.source = { :git => "https://github.com/tadasr/react-native-iot-wifi.git", :tag => "#{s.version}" } | ||
s.source_files = "ios/**/*.{h,m}" | ||
s.dependancy = "React" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had to change this line along with @josectobar's recommendation in order to get this to work.
s.dependancy = "React" | |
s.dependency 'React' |
Adding the podspec and
pod 'react-native-iot-wifi', :podspec => '../node_modules/react-native-iot-wifi/ios/react-native-iot-wifi.podspec'
to the user'sPodfile
will allow those using this on React Native >=0.60 to auto-link.