Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Upgrade native SDKs #106

Merged
merged 13 commits into from
May 23, 2023
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,8 @@ First, install the npm package with yarn. _Autolink_ is automatic.
Inside your `AppDelegate.m`, setup the line sdk by passing the channel id obtained.

1. Add `platform :ios, '10.0'` in `Podfile` line:1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't be 11 or 12?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

2. Enable `use_frameworks!` in `Podfile` line:3
3. Comment the code related to flipper, flipper doesn't support `use_frameworks!` !
4. Modify your info.plist like it says here [Configuring the Info.plist file](https://developers.line.biz/en/docs/ios-sdk/swift/setting-up-project/#configuring-the-info-plist-file)
5. Change your `AppDelegate.m` to match the following:
2. Modify your info.plist like it says here [Configuring the Info.plist file](https://developers.line.biz/en/docs/ios-sdk/swift/setting-up-project/#configuring-the-info-plist-file)
3. Change your `AppDelegate.m` to match the following:

```objc
// AppDelegate.m
Expand Down
6 changes: 3 additions & 3 deletions RNLine.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ Pod::Spec.new do |s|

s.authors = package['author']
s.homepage = package['homepage']
s.platform = :ios, "10.0"
s.platform = :ios, "11.0"
s.swift_version = '5.0'

s.source = { :git => "" }
s.source_files = "ios/**/*.{h,m,swift}"

s.dependency 'React'
s.dependency 'LineSDKSwift', '~> 5.0'
s.dependency 'React-Core'
s.dependency 'LineSDKSwift', '~> 5.8.1'
end
31 changes: 11 additions & 20 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,33 +1,23 @@
buildscript {
//Buildscript is evaluated before everything else so we can't use getExtOrDefault
def kotlin_version = rootProject.ext.has('kotlinVersion') ? rootProject.ext.get('kotlinVersion') : project.properties['ReactNativeLine_kotlinVersion']
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 21
compileSdkVersion = 28
targetSdkVersion = 28
coroutinesAndroidVersion = "1.0.1"
coroutinesCoreVersion = "1.0.1"
gsonVersion = "2.8.6"
linesdkVersion = "5.1.1"
kotlinVersion = '1.7.21'
}
repositories {
google()
jcenter()
mavenCentral()
}

dependencies {
classpath "com.android.tools.build:gradle:3.5.1"
classpath "com.android.tools.build:gradle:7.0.4"
//noinspection DifferentKotlinGradleVersion
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "com.linecorp:linesdk:5.1.1"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
}
}

repositories {
google()

jcenter()
mavenCentral()
}

apply plugin: "com.android.library"
Expand All @@ -39,7 +29,7 @@ def safeExtGet(prop, fallback) {
}

android {
compileSdkVersion safeExtGet("compileSdkVersion", 28)
compileSdkVersion safeExtGet("compileSdkVersion", 31)

defaultConfig {
minSdkVersion safeExtGet('minSdkVersion', 21)
Expand All @@ -57,9 +47,10 @@ android {
}

dependencies {
//noinspection GradleDynamicVersion from node modules
implementation "com.facebook.react:react-native:+"
implementation "com.linecorp:linesdk:5.1.1"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.50"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutinesAndroidVersion"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesCoreVersion"
implementation "com.linecorp.linesdk:linesdk:5.8.0"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.0.1"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.0.1"
}
6 changes: 1 addition & 5 deletions android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
ReactNativeLine_kotlinVersion=1.3.50
ReactNativeLine_compileSdkVersion=28
ReactNativeLine_buildToolsVersion=28.0.3
ReactNativeLine_targetSdkVersion=28
ReactNativeLine_lineSdkVersion=5.1.1
android.useAndroidX=true
2 changes: 1 addition & 1 deletion ios/LineLogin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import LineSDK

if let botPrompt = args["botPrompt"] as? String {
switch botPrompt {
case "aggressive": parameters.botPromptStyle = LoginManager.BotPrompt(rawValue: "aggresive")
case "aggressive": parameters.botPromptStyle = LoginManager.BotPrompt(rawValue: "aggressive")
case "normal": parameters.botPromptStyle = LoginManager.BotPrompt(rawValue: "normal")
default: break
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
],
"main": "dist/index.js",
"types": "dist/index.d.ts",
"version": "2.1.0",
"version": "2.2.0",
"homepage": "https://github.com/xmartlabs/react-native-line#readme",
"keywords": [
"react-native",
Expand Down
2 changes: 1 addition & 1 deletion src/lineSDKWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import {
AccessToken,
AccessTokenVerifyResult,
BotFriendshipStatus,
LoginArguments,
LoginResult,
UserProfile,
LoginArguments,
} from './types'

const { LineLogin } = NativeModules
Expand Down