diff --git a/WordPressKit.podspec b/WordPressKit.podspec index acd9805c..ef17bb88 100644 --- a/WordPressKit.podspec +++ b/WordPressKit.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "WordPressKit" - s.version = "4.5.1" + s.version = "4.5.2-beta.1" s.summary = "WordPressKit offers a clean and simple WordPress.com and WordPress.org API." s.description = <<-DESC diff --git a/WordPressKit/AccountServiceRemoteREST.m b/WordPressKit/AccountServiceRemoteREST.m index 795bd936..6670ff8f 100644 --- a/WordPressKit/AccountServiceRemoteREST.m +++ b/WordPressKit/AccountServiceRemoteREST.m @@ -202,6 +202,7 @@ - (void)requestWPComAuthLinkForEmail:(NSString *)email path:path clientID:clientID clientSecret:clientSecret + extraParams: nil wpcomScheme:scheme success:success failure:failure]; @@ -217,11 +218,14 @@ - (void)requestWPComSignupLinkForEmail:(NSString *)email NSString *path = [self pathForEndpoint:@"auth/send-signup-email" withVersion:ServiceRemoteWordPressComRESTApiVersion_1_1]; - + + NSDictionary *signupFlowParam = @{@"signup_flow_name": @"mobile-ios"}; + [self requestWPComMagicLinkForEmail:email path:path clientID:clientID clientSecret:clientSecret + extraParams:signupFlowParam wpcomScheme:scheme success:success failure:failure]; @@ -231,6 +235,7 @@ - (void)requestWPComMagicLinkForEmail:(NSString *)email path:(NSString *)path clientID:(NSString *)clientID clientSecret:(NSString *)clientSecret + extraParams:(nullable NSDictionary *)extraParams wpcomScheme:(NSString *)scheme success:(void (^)(void))success failure:(void (^)(NSError *error))failure @@ -241,10 +246,15 @@ - (void)requestWPComMagicLinkForEmail:(NSString *)email @"email": email, @"client_id": clientID, @"client_secret": clientSecret - }]; + }]; + if (![@"wordpress" isEqualToString:scheme]) { [params setObject:scheme forKey:@"scheme"]; } + + if (extraParams != nil) { + [params addEntriesFromDictionary:extraParams]; + } [self.wordPressComRestApi POST:path parameters:[NSDictionary dictionaryWithDictionary:params]