Skip to content

Commit 21370be

Browse files
committed
add function change the consumer key and secret.
1 parent 19ded47 commit 21370be

File tree

2 files changed

+29
-2
lines changed

2 files changed

+29
-2
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>

StudyplusSDK/Studyplus.swift

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@ final public class Studyplus {
5555

5656
StudyplusAPI用のConsumer Keyです。
5757
*/
58-
public let consumerKey: String
58+
public private(set) var consumerKey: String
5959

6060
/**
6161
Consumer Secret for Studyplus API.
6262

6363
StudyplusAPI用のConsumer Secretです。
6464
*/
65-
public let consumerSecret: String
65+
public private(set) var consumerSecret: String
6666

6767
/**
6868
see StudyplusLoginDelegate protocol
@@ -225,6 +225,25 @@ final public class Studyplus {
225225
return true
226226
}
227227

228+
/// Change the consumer key and secret.
229+
/// You can call this method to switch to a different key when logging in to Studyplus or posting study records.
230+
/// If multiple applications are connected with Studyplus, you need to call this method.
231+
/// If there is only one connected application, you do not need to call this method.
232+
///
233+
/// StudyplusAPI用のConsumer Key と Secret を変更します。
234+
/// このメソッドを呼ぶと、Studyplusにログインしたり、勉強記録を投稿するときに別の Consumer Key と Secret に切り替えることができます。
235+
/// 複数のアプリケーションがStudyplusと連携されている場合は、このメソッドを呼ぶ必要があります。
236+
/// 連携されたアプリケーションが1つしかない場合は、このメソッドを呼ぶ必要はありません。
237+
///
238+
/// - Parameter
239+
/// - consumerKey: consumer key
240+
/// - consumerSecret: consumer secret
241+
public func change(consumerKey: String, consumerSecret: String) {
242+
243+
self.consumerKey = consumerKey
244+
self.consumerSecret = consumerSecret
245+
}
246+
228247
// MARK: - private method
229248

230249
private init() {

0 commit comments

Comments
 (0)