Skip to content
This repository was archived by the owner on Apr 7, 2021. It is now read-only.

Commit c4bb039

Browse files
Merge pull request #18 from studyplus/stop_support_ios8
Stop support ios8
2 parents 6048627 + 0191ef4 commit c4bb039

File tree

9 files changed

+55
-52
lines changed

9 files changed

+55
-52
lines changed

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
2.0.0 Release notes (2019-09-24)
2+
=============================================================
3+
4+
### API Breaking Changes
5+
6+
* Stoped support iOS8.
7+
* LSApplicationQueriesSchemes is always required to see if studyplus is installed. Please check README.md.
8+
9+
### Enhancements
10+
11+
* None.
12+
13+
### Bugfixes
14+
15+
* Fixed to check if studyplus is installed.
16+
117
1.3.6 Release notes (2019-08-30)
218
=============================================================
319

Demo/AppDelegate.swift

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
5151
func applicationWillTerminate(_ application: UIApplication) {
5252
}
5353

54-
// MARK: - iOS8
55-
56-
func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool {
57-
print("-- called application(_:open:sourceApplication:annotation:) --")
58-
return Studyplus.shared.handle(appDelegateUrl: url)
59-
}
60-
61-
// MARK: - iOS9 or above
62-
6354
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
6455
print("-- called application(_:open:options:) --")
6556
return Studyplus.shared.handle(appDelegateUrl: url)

Demo/Info.plist

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
44
<dict>
5+
<key>LSApplicationQueriesSchemes</key>
6+
<array>
7+
<string>studyplus</string>
8+
</array>
59
<key>CFBundleDevelopmentRegion</key>
610
<string>en</string>
711
<key>CFBundleExecutable</key>
@@ -15,7 +19,7 @@
1519
<key>CFBundlePackageType</key>
1620
<string>APPL</string>
1721
<key>CFBundleShortVersionString</key>
18-
<string>1.3.6</string>
22+
<string>2.0.0</string>
1923
<key>CFBundleURLTypes</key>
2024
<array>
2125
<dict>

Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
platform :ios, '8.0'
1+
platform :ios, '9.0'
22

33
use_frameworks!
44

README.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ StudyplusSDK-V2 is [Studyplus iOS SDK](https://github.com/studyplus/Studyplus-iO
55

66
## Requirements
77

8-
* iOS 8.0 or above
8+
* iOS 9.0 or above
99
* Swift 4.0 or above
1010

1111
## Dependency
@@ -33,17 +33,17 @@ github "studyplus/Studyplus-iOS-SDK-V2"
3333

3434
- If you don't have consumerKey and consumerSecret, please contact https://info.studyplus.co.jp/contact/studyplus-api
3535

36-
### Set up custom URL scheme
36+
### Set up custom URL scheme
3737

3838
- set __studyplus-*{your consumer key}*__ to URL Types. (ex. studyplus-MIoh79q7pfMbTUVA3BNsSeTaZRcOK3yg )
3939

4040
![xcode](https://github.com/studyplus/Studyplus-iOS-SDK-V2/blob/master/docs/set_url_scheme.png)
4141

42-
### Set up consumerKey and consumerSecret
42+
### Set up consumerKey and consumerSecret
4343

4444
- set __consumerKey__ and __consumerSecret__ in your Info.plist.
4545

46-
```plist
46+
```
4747
<key>StudyplusSDK</key>
4848
<dict>
4949
<key>consumerKey</key>
@@ -53,6 +53,17 @@ github "studyplus/Studyplus-iOS-SDK-V2"
5353
</dict>
5454
```
5555

56+
### ③ Set up LSApplicationQueriesSchemes
57+
58+
- Set LSApplicationQueriesSchemes in your info.plist for checking if studyplus is installed.
59+
60+
```
61+
<key>LSApplicationQueriesSchemes</key>
62+
<array>
63+
<string>studyplus</string>
64+
</array>
65+
```
66+
5667
### Initialize
5768

5869
```Swift
@@ -79,16 +90,6 @@ import StudyplusSDK_V2
7990

8091
class AppDelegate: UIResponder, UIApplicationDelegate {
8192

82-
// ...
83-
84-
// MARK: - iOS8
85-
86-
func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool {
87-
return Studyplus.shared.handle(appDelegateUrl: url)
88-
}
89-
90-
// MARK: - iOS9 or above
91-
9293
func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
9394
return Studyplus.shared.handle(appDelegateUrl: url)
9495
}

StudyplusSDK-V2.podspec

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
Pod::Spec.new do |s|
22
s.name = "StudyplusSDK-V2"
3-
s.version = "1.3.6"
3+
s.version = "2.0.0"
44
s.summary = "StudyplusSDK-V2 is Studyplus iOS SDK for Swift"
55
s.homepage = "https://info.studyplus.jp"
66
s.license = { :type => "MIT", :file => "LICENSE" }
77
s.source = { :git => "https://github.com/studyplus/Studyplus-iOS-SDK-V2.git", :tag => s.version }
88
s.source_files = "StudyplusSDK", "StudyplusSDK/**/*.{swift}"
99
s.requires_arc = true
10-
s.platform = :ios, '8.0'
11-
s.ios.deployment_target = '8.0'
10+
s.platform = :ios, '9.0'
11+
s.ios.deployment_target = '9.0'
1212
s.ios.frameworks = ['UIKit', 'Foundation']
1313
s.author = { 'Studyplus inc' => '[email protected]' }
1414
s.swift_versions = ['4.2', '5.0']

StudyplusSDK.xcodeproj/project.pbxproj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,7 @@
655655
);
656656
INFOPLIST_FILE = StudyplusSDK/Info.plist;
657657
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
658+
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
658659
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
659660
OTHER_SWIFT_FLAGS = "$(inherited)";
660661
PRODUCT_BUNDLE_IDENTIFIER = com.studyplus.StudyplusSDK;
@@ -682,6 +683,7 @@
682683
);
683684
INFOPLIST_FILE = StudyplusSDK/Info.plist;
684685
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
686+
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
685687
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
686688
OTHER_SWIFT_FLAGS = "$(inherited)";
687689
PRODUCT_BUNDLE_IDENTIFIER = com.studyplus.StudyplusSDK;
@@ -723,7 +725,7 @@
723725
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
724726
DEVELOPMENT_TEAM = "";
725727
INFOPLIST_FILE = Demo/Info.plist;
726-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
728+
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
727729
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
728730
OTHER_SWIFT_FLAGS = "$(inherited)";
729731
PRODUCT_BUNDLE_IDENTIFIER = com.studyplus.Demo;
@@ -740,7 +742,7 @@
740742
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
741743
DEVELOPMENT_TEAM = "";
742744
INFOPLIST_FILE = Demo/Info.plist;
743-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
745+
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
744746
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
745747
OTHER_SWIFT_FLAGS = "$(inherited)";
746748
PRODUCT_BUNDLE_IDENTIFIER = com.studyplus.Demo;

StudyplusSDK/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>1.3.6</string>
18+
<string>2.0.0</string>
1919
<key>CFBundleVersion</key>
2020
<string>$(CURRENT_PROJECT_VERSION)</string>
2121
<key>NSPrincipalClass</key>

StudyplusSDK/Studyplus.swift

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ final public class Studyplus {
4141

4242
StudyplusSDKのバージョンを返します
4343
*/
44-
public static let SDKVersion: String = "1.3.6"
44+
public static let SDKVersion: String = "2.0.0"
4545

4646
/**
4747
Returns the shared defaults object.
@@ -75,25 +75,16 @@ final public class Studyplus {
7575
see StudyplusLoginDelegate protocol
7676
*/
7777
public weak var delegate: StudyplusLoginDelegate?
78-
79-
/**
80-
When set to true, if Studyplus is not installed, AppStore starts when auth/login methods are called.
81-
82-
trueの場合、auth、loginメソッドを呼び出したとき、StudyplusアプリがインストールされていなければAppStoreを起動します。
83-
*/
84-
public var openAppStoreIfNotInstalled: Bool = true
8578

8679
private let accessTokenStoreKey: String = "accessToken"
8780
private let usernameStoreKey: String = "username"
8881

8982
/// Opens the login screen by invoking the Studyplus application.
90-
/// If Studyplus app is not installed and openAppStoreIfNotInstalled is true, then open the Studyplus page in AppStore.
91-
/// If openAppStoreIfNotInstalled is false, do nothing.
83+
/// If Studyplus app is not installed, open the Studyplus page in AppStore.
9284
/// After the process has returned from Studyplus application, delegate method will be called back.
9385
///
9486
/// Studyplusアプリを起動してStudyplusログイン画面を開きます。
95-
/// Studyplusアプリがインストールされていない場合、 openAppStoreIfNotInstalled が true であれば、AppStore を起動して Studyplus を開きます。
96-
/// openAppStoreIfNotInstalled が false であれば何もしません。
87+
/// Studyplusアプリがインストールされていない場合、AppStore を起動して Studyplus を開きます。
9788
/// Studyplusアプリから操作が戻ってきた後、delegateオブジェクトのコールバックメソッドを呼び出します。
9889
public func login() {
9990
openStudyplus(command: "auth")
@@ -299,20 +290,18 @@ final public class Studyplus {
299290

300291
private func openStudyplus(command: String) {
301292

293+
guard UIApplication.shared.canOpenURL(URL(string: "studyplus://")!) else {
294+
let appStoreURLString: String = "https://apps.apple.com/jp/app/id505410049?mt=8"
295+
guard let appStoreURL = URL(string: appStoreURLString) else { return }
296+
applicationOpen(appStoreURL)
297+
return
298+
}
299+
302300
let urlString: String = "studyplus://external_app/" + command + "/" + consumerKey + "/" + consumerSecret
303301

304302
if let url = URL(string: urlString) {
305303

306304
applicationOpen(url)
307-
308-
} else {
309-
310-
if self.openAppStoreIfNotInstalled {
311-
312-
let appStoreURLString: String = "https://apps.apple.com/jp/app/id505410049?mt=8"
313-
guard let appStoreURL = URL(string: appStoreURLString) else { return }
314-
applicationOpen(appStoreURL)
315-
}
316305
}
317306
}
318307

0 commit comments

Comments
 (0)