Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Add Migration Guide to 2.0.0 #16

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis/before-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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__
Expand Down
86 changes: 86 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,92 @@ project(':tipsi-twitter').projectDir = new File(rootProject.projectDir, '../node
</application>
```

## 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 <Fabric/Fabric.h>

// add this line
#import <TwitterKit/TwitterKit.h>

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
...
// remove this line
[Fabric with:@[[Twitter class]]];
...
}

- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString *,id> *)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`:

```
...
<key>CFBundleURLTypes</key>
<array>
...
// add this object
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>twitterkit-<YOUR_TWITTER_KEY></string>
</array>
</dict>
...
</array>
...
```

– Add twitter queries schemes `LSApplicationQueriesSchemes` to `Info.plist`:

```
...
<key>LSApplicationQueriesSchemes</key>
<array>
// add this two lines
<string>twitter</string>
<string>twitterauth</string>
</array>
...
```

## Usage

```js
Expand Down
3 changes: 2 additions & 1 deletion example/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions scripts/local-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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__
Expand Down
3 changes: 1 addition & 2 deletions scripts/post-link-ios.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -38,7 +38,6 @@
end
else
puts "TwitterKit pod is already added in Podfile\n"
exit
end
else
puts 'Adding Podfile to iOS project'
Expand Down