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

Commit

Permalink
Merge pull request #219 from NIFCLOUD-mbaas/develop
Browse files Browse the repository at this point in the history
リリース 3.1.0 (DEV->MASTER)
  • Loading branch information
kobo0908 authored Mar 26, 2020
2 parents a609e7b + 73eef06 commit 06072ba
Show file tree
Hide file tree
Showing 10 changed files with 569 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: objective-c
osx_image: xcode8.3
osx_image: xcode11.3
xcode_workspace: NCMBTests/NCMBTests.xcworkspace
xcode_scheme: NCMBTests
xcode_sdk: iphonesimulator
Expand Down
4 changes: 2 additions & 2 deletions NCMB.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "NCMB"
s.version = "3.0.4"
s.version = "3.1.0"
s.summary = "NCMB is SDK for NIFCLOUD mobile backend."
s.description = <<-DESC
NCMB is SDK for NIFCLOUD mobile backend.
Expand All @@ -15,7 +15,7 @@ Pod::Spec.new do |s|
s.license = "Apache License, Version 2.0"
s.author = "FUJITSU CLOUD TECHNOLOGIES LIMITED"
s.platform = :ios, "5.1"
s.source = { :git => 'https://github.com/NIFCLOUD-mbaas/ncmb_ios.git', :tag => 'v3.0.4' }
s.source = { :git => 'https://github.com/NIFCLOUD-mbaas/ncmb_ios.git', :tag => 'v3.1.0' }
s.source_files = "NCMB/**/*.{h,m,c}"
s.frameworks = "Foundation", "UIKit", "MobileCoreServices", "AudioToolbox", "SystemConfiguration"
s.requires_arc = true
Expand Down
2 changes: 1 addition & 1 deletion NCMB/NCMBConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#pragma mark - error
#define ERRORDOMAIN @"NCMBErrorDomain"
#define SDK_VERSION @"3.0.4"
#define SDK_VERSION @"3.1.0"

#define DATA_MAIN_PATH [NSHomeDirectory() stringByAppendingPathComponent:@"Library/"]
#define COMMAND_CACHE_FOLDER_PATH [NSString stringWithFormat:@"%@/Private Documents/NCMB/Command Cache/", DATA_MAIN_PATH]
Expand Down
19 changes: 17 additions & 2 deletions NCMB/NCMBUser.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,13 @@
*/
- (void)signUpWithFacebookToken:(NSDictionary *)facebookInfo withBlock:(NCMBErrorResultBlock)block;

/**
appleのauthDataをもとにニフクラ mobile backendへの会員登録(ログイン)を行う
@param appleInfo apple認証に必要なauthData
@param block サインアップ後に実行されるblock
*/
- (void)signUpWithAppleToken:(NSDictionary *)appleInfo withBlock:(NCMBErrorResultBlock)block;

#pragma mark requestAuthenticationMail
/** @name requestAuthenticationMail */

Expand Down Expand Up @@ -346,16 +353,24 @@
- (void)linkWithFacebookToken:(NSDictionary *)facebookInfo
withBlock:(NCMBErrorResultBlock)block;

/**
ログイン中のユーザー情報に、appleの認証情報を紐付ける
@param appleInfo appleの認証情報
@param block 既存のauthDataのapple情報のみ更新後実行されるblock。エラーがあればエラーのポインタが、なければnilが渡される。
*/
- (void)linkWithAppleToken:(NSDictionary *)appleInfo
withBlock:(NCMBErrorResultBlock)block;

/**
会員情報に、引数で指定したtypeの認証情報が含まれているか確認する
@param type 認証情報のtype(googleもしくはtwitter、facebook、anonymous)
@param type 認証情報のtype(googleもしくはtwitter、facebook、apple、anonymous)
@return 引数で指定したtypeの会員情報が含まれている場合はYESを返す
*/
- (BOOL)isLinkedWith:(NSString *)type;

/**
会員情報から、引数で指定したtypeの認証情報を削除する
@param type 認証情報のtype(googleもしくはtwitter、facebook、anonymous)
@param type 認証情報のtype(googleもしくはtwitter、facebook、apple、anonymous)
@param block エラー情報を返却するblock エラーがあればエラーのポインタが、なければnilが渡される。
*/
- (void)unlink:(NSString *)type
Expand Down
32 changes: 29 additions & 3 deletions NCMB/NCMBUser.m
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ @implementation NCMBUser
#define AUTH_TYPE_TWITTER @"twitter"
#define AUTH_TYPE_FACEBOOK @"facebook"
#define AUTH_TYPE_ANONYMOUS @"Anonymous"
#define AUTH_TYPE_APPLE @"apple"

static NCMBUser *currentUser = nil;
static BOOL isEnableAutomaticUser = NO;
Expand Down Expand Up @@ -294,6 +295,18 @@ - (void)signUpWithFacebookToken:(NSDictionary *)facebookInfo withBlock:(NCMBErro
[self signUpWithToken:facebookInfo withType:AUTH_TYPE_FACEBOOK withBlock:block];
}

/**
appleのauthDataをもとにニフクラ mobile backendへの会員登録(ログイン)を行う
@param appleInfo apple認証に必要なauthData
@param block サインアップ後に実行されるblock
*/
- (void)signUpWithAppleToken:(NSDictionary *)appleInfo withBlock:(NCMBErrorResultBlock)block{
NSString *bundleIdentifier = [[NSBundle mainBundle] bundleIdentifier];
NSDictionary *appleInfoParam = [appleInfo mutableCopy];
[appleInfoParam setValue:bundleIdentifier forKey:@"client_id"];
[self signUpWithToken:appleInfoParam withType:AUTH_TYPE_APPLE withBlock:block];
}

#pragma mark - signUpAnonymous

- (void)signUpFromAnonymous:(NSString *)userName password:(NSString *)password error:(NSError **)error{
Expand Down Expand Up @@ -1062,9 +1075,21 @@ - (void)linkWithFacebookToken:(NSDictionary *)facebookInfo withBlock:(NCMBErrorR
[self linkWithToken:facebookInfo withType:AUTH_TYPE_FACEBOOK withBlock:block];
}

/**
ログイン中のユーザー情報に、appleの認証情報を紐付ける
@param appleInfo appleの認証情報
@param block 既存のauthDataのapple情報のみ更新後実行されるblock。エラーがあればエラーのポインタが、なければnilが渡される。
*/
- (void)linkWithAppleToken:(NSDictionary *)appleInfo withBlock:(NCMBErrorResultBlock)block{
NSString *bundleIdentifier = [[NSBundle mainBundle] bundleIdentifier];
NSDictionary *appleInfoParam = [appleInfo mutableCopy];
[appleInfoParam setValue:bundleIdentifier forKey:@"client_id"];
[self linkWithToken:appleInfoParam withType:AUTH_TYPE_APPLE withBlock:block];
}

/**
会員情報に、引数で指定したtypeの認証情報が含まれているか確認する
@param type 認証情報のtype(googleもしくはtwitter、facebook、anonymous)
@param type 認証情報のtype(googleもしくはtwitter、facebook、apple、anonymous)
@return 引数で指定したtypeの会員情報が含まれている場合はYESを返す
*/
- (BOOL)isLinkedWith:(NSString *)type{
Expand All @@ -1073,7 +1098,8 @@ - (BOOL)isLinkedWith:(NSString *)type{
if ([type isEqualToString:AUTH_TYPE_GOOGLE]
|| [type isEqualToString:AUTH_TYPE_TWITTER]
|| [type isEqualToString:AUTH_TYPE_FACEBOOK]
|| [type isEqualToString:AUTH_TYPE_ANONYMOUS])
|| [type isEqualToString:AUTH_TYPE_ANONYMOUS]
|| [type isEqualToString:AUTH_TYPE_APPLE])
{
if ([self objectForKey:@"authData"] && [[self objectForKey:@"authData"] isKindOfClass:[NSDictionary class]]) {
if ([[self objectForKey:@"authData"] objectForKey:type]) {
Expand All @@ -1086,7 +1112,7 @@ - (BOOL)isLinkedWith:(NSString *)type{

/**
会員情報から、引数で指定したtypeの認証情報を削除する
@param type 認証情報のtype(googleもしくはtwitter、facebook、anonymous)
@param type 認証情報のtype(googleもしくはtwitter、facebook、apple、anonymous)
@param block エラー情報を返却するblock エラーがあればエラーのポインタが、なければnilが渡される。
*/
- (void)unlink:(NSString *)type withBlock:(NCMBErrorResultBlock)block{
Expand Down
2 changes: 1 addition & 1 deletion NCMB/NCMB_Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>3.0.4</string>
<string>3.1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
2 changes: 1 addition & 1 deletion NCMBTests/NCMBTests/NCMBInstallationSpec.m
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ -(NSMutableDictionary *)beforeConnection;
},
@"applicationName" : @"aaaa",
@"objectId" : @"EVMu2ne7bjzZhOW2",
@"sdkVersion" : @"3.0.4"
@"sdkVersion" : @"3.1.0"
};

NSDictionary *responseInstallation = @{@"channels" : @[
Expand Down
Loading

0 comments on commit 06072ba

Please sign in to comment.