diff --git a/.travis/before-install.sh b/.travis/before-install.sh index b677788..28a9f54 100755 --- a/.travis/before-install.sh +++ b/.travis/before-install.sh @@ -14,6 +14,7 @@ init_new_example_project() { android/app/build.gradle android/app/src/main/AndroidManifest.xml ios/example/Info.plist + ios/Podfile src scripts __tests__ diff --git a/README.md b/README.md index d8288a0..4c1f018 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,92 @@ project(':tipsi-twitter').projectDir = new File(rootProject.projectDir, '../node ``` +## Migration guide to 2.0.0 + +### iOS + +Version `2.0.0` works with iOS 9+. In order to to migrate you should: + +1. Update `iOS Deployment Target` (`IPHONEOS_DEPLOYMENT_TARGET`) for your target in `.xcodeproj`. + +2. Update `platform` in `Podfile`: + +``` +// remove this line +platform :ios, '8.0' + +// add this line +platform :ios, '9.0' +``` + +2. Update `TwitterKit` pod dependency in `Podfile`: + +``` +// remove this line +pod 'TwitterKit', '2.7.0' + +// add this line +pod 'TwitterKit', '~> 3.1' +``` + +3. Update object which implement `UIApplicationDelegate` (more often `AppDelegate.m`): + +``` +// remove this line +#import + +// add this line +#import + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + ... + // remove this line + [Fabric with:@[[Twitter class]]]; + ... +} + +- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options { + // add this line + return [[Twitter sharedInstance] application:app openURL:url options:options]; +} +``` + +4. Update `Info.plist File` (`INFOPLIST_FILE`) (more ofter `Info.plist`): + +– Remove `Fabric` key and related object from `Info.plist`. + +– Add new URL type to `Info.plist`: + +``` +... +CFBundleURLTypes + + ... + // add this object + + CFBundleURLSchemes + + twitterkit- + + + ... + +... +``` + +– Add twitter queries schemes `LSApplicationQueriesSchemes` to `Info.plist`: + +``` +... +LSApplicationQueriesSchemes + + // add this two lines + twitter + twitterauth + +... +``` + ## Usage ```js diff --git a/example/ios/Podfile b/example/ios/Podfile index 3e3e928..745dd24 100644 --- a/example/ios/Podfile +++ b/example/ios/Podfile @@ -2,5 +2,6 @@ platform :ios, '9.0' target 'example' do - pod 'TwitterKit', '~> 3.1' + pod 'TwitterKit', '3.1.1' + pod 'TwitterCore', '3.0.1' end diff --git a/scripts/local-ci.sh b/scripts/local-ci.sh index afc25dd..558beca 100755 --- a/scripts/local-ci.sh +++ b/scripts/local-ci.sh @@ -28,6 +28,7 @@ files_to_copy=( android/app/build.gradle android/app/src/main/AndroidManifest.xml ios/example/Info.plist + ios/Podfile src scripts __tests__ diff --git a/scripts/post-link-ios.rb b/scripts/post-link-ios.rb index e0d1f70..ee82ba0 100644 --- a/scripts/post-link-ios.rb +++ b/scripts/post-link-ios.rb @@ -7,7 +7,7 @@ Dir.chdir('ios') @podfile_path = Pathname.pwd + 'Podfile' -@pod_dep = " pod 'TwitterKit', '~> 3.1'\n" +@pod_dep = " pod 'TwitterKit', '3.1.1'\n" @project_paths= Pathname.pwd.children.select { |pn| pn.extname == '.xcodeproj' } raise 'No Xcode project found' unless @project_paths.length > 0 @@ -38,7 +38,6 @@ end else puts "TwitterKit pod is already added in Podfile\n" - exit end else puts 'Adding Podfile to iOS project'