diff --git a/WordPressKit.podspec b/WordPressKit.podspec index 50d3e7bc..adeef324 100644 --- a/WordPressKit.podspec +++ b/WordPressKit.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "WordPressKit" - s.version = "2.1.1-beta.2" + s.version = "3.0.0-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 7efce806..39536c73 100644 --- a/WordPressKit/AccountServiceRemoteREST.m +++ b/WordPressKit/AccountServiceRemoteREST.m @@ -242,8 +242,7 @@ - (void)requestWPComMagicLinkForEmail:(NSString *)email NSMutableDictionary *params = [NSMutableDictionary dictionaryWithDictionary:@{ @"email": email, @"client_id": clientID, - @"client_secret": clientSecret, - @"locale": [[WordPressComLanguageDatabase new] deviceLanguageSlug], + @"client_secret": clientSecret }]; if (![@"wordpress" isEqualToString:scheme]) { [params setObject:scheme forKey:@"scheme"]; diff --git a/WordPressKit/ActivityServiceRemote.swift b/WordPressKit/ActivityServiceRemote.swift index 5b3f9632..b0a0bb3a 100644 --- a/WordPressKit/ActivityServiceRemote.swift +++ b/WordPressKit/ActivityServiceRemote.swift @@ -26,10 +26,8 @@ public class ActivityServiceRemote: ServiceRemoteWordPressComREST { failure: @escaping (Error) -> Void) { let endpoint = "sites/\(siteID)/activity" let path = self.path(forEndpoint: endpoint, withVersion: ._2_0) - let locale = WordPressComLanguageDatabase().deviceLanguage.slug let pageNumber = (offset / count + 1) let parameters: [String: AnyObject] = [ - "locale": locale as AnyObject, "number": count as AnyObject, "page": pageNumber as AnyObject ] @@ -64,13 +62,9 @@ public class ActivityServiceRemote: ServiceRemoteWordPressComREST { failure: @escaping (Error) -> Void) { let endpoint = "sites/\(siteID)/rewind" let path = self.path(forEndpoint: endpoint, withVersion: ._2_0) - let locale = WordPressComLanguageDatabase().deviceLanguage.slug - let parameters: [String: AnyObject] = [ - "locale": locale as AnyObject - ] wordPressComRestApi.GET(path, - parameters: parameters, + parameters: nil, success: { response, _ in guard let rewindStatus = response as? [String: AnyObject] else { failure(ResponseError.decodingFailure) diff --git a/WordPressKit/PlanServiceRemote.swift b/WordPressKit/PlanServiceRemote.swift index e71c174e..97a20d37 100644 --- a/WordPressKit/PlanServiceRemote.swift +++ b/WordPressKit/PlanServiceRemote.swift @@ -19,11 +19,9 @@ public class PlanServiceRemote: ServiceRemoteWordPressComREST { public func getWpcomPlans(_ success: @escaping (AvailablePlans) -> Void, failure: @escaping (Error) -> Void) { let endpoint = "plans/mobile" let path = self.path(forEndpoint: endpoint, withVersion: ._2_0) - let locale = WordPressComLanguageDatabase().deviceLanguage.slug - let parameters = ["locale": locale] wordPressComRestApi.GET(path, - parameters: parameters as [String : AnyObject]?, + parameters: nil, success: { response, _ in diff --git a/WordPressKit/PlanServiceRemote_ApiVersion1_3.swift b/WordPressKit/PlanServiceRemote_ApiVersion1_3.swift index bca1f5a6..1087b05a 100644 --- a/WordPressKit/PlanServiceRemote_ApiVersion1_3.swift +++ b/WordPressKit/PlanServiceRemote_ApiVersion1_3.swift @@ -11,11 +11,10 @@ import CocoaLumberjack failure: @escaping (Error) -> Void) { let endpoint = "sites/\(siteID)/plans" let path = self.path(forEndpoint: endpoint, withVersion: ._1_3) - let locale = WordPressComLanguageDatabase().deviceLanguage.slug - let parameters = ["locale": locale] + wordPressComRestApi.GET( path, - parameters: parameters as [String : AnyObject]?, + parameters: nil, success: { response, _ in do { diff --git a/WordPressKit/ReaderSiteSearchServiceRemote.swift b/WordPressKit/ReaderSiteSearchServiceRemote.swift index c70bb591..6d2c186c 100644 --- a/WordPressKit/ReaderSiteSearchServiceRemote.swift +++ b/WordPressKit/ReaderSiteSearchServiceRemote.swift @@ -25,9 +25,7 @@ public class ReaderSiteSearchServiceRemote: ServiceRemoteWordPressComREST { failure: @escaping (Error) -> Void) { let endpoint = "read/feed" let path = self.path(forEndpoint: endpoint, withVersion: ._1_1) - let locale = WordPressComLanguageDatabase().deviceLanguage.slug let parameters: [String: AnyObject] = [ - "locale": locale as AnyObject, "number": count as AnyObject, "offset": offset as AnyObject, "exclude_followed": false as AnyObject, diff --git a/WordPressKit/TimeZoneServiceRemote.swift b/WordPressKit/TimeZoneServiceRemote.swift index cf0b46ef..255bcda5 100644 --- a/WordPressKit/TimeZoneServiceRemote.swift +++ b/WordPressKit/TimeZoneServiceRemote.swift @@ -9,9 +9,7 @@ public class TimeZoneServiceRemote: ServiceRemoteWordPressComREST { public func getTimezones(success: @escaping (([TimeZoneGroup]) -> Void), failure: @escaping ((Error) -> Void)) { let endpoint = "timezones" let path = self.path(forEndpoint: endpoint, withVersion: ._2_0) - let locale = WordPressComLanguageDatabase().deviceLanguage.slug - let parameters: [String: AnyObject] = ["_locale": locale as AnyObject] - wordPressComRestApi.GET(path, parameters: parameters, success: { (response, _) in + wordPressComRestApi.GET(path, parameters: nil, success: { (response, _) in do { let groups = try self.timezoneGroupsFromResponse(response) success(groups) diff --git a/WordPressKit/WordPressComServiceRemote.h b/WordPressKit/WordPressComServiceRemote.h index f673baac..95457857 100644 --- a/WordPressKit/WordPressComServiceRemote.h +++ b/WordPressKit/WordPressComServiceRemote.h @@ -22,14 +22,12 @@ typedef void(^WordPressComServiceFailureBlock)(NSError *error); * @param email The email to use for the new account. Cannot be nil. * @param username The username of the new account. Cannot be nil. * @param password The password of the new account. Cannot be nil. - * @param locale The locale for the new account. Cannot be nil. * @param success The block to execute on success. Can be nil. * @param failure The block to execute on failure. Can be nil. */ - (void)createWPComAccountWithEmail:(NSString *)email andUsername:(NSString *)username andPassword:(NSString *)password - andLocale:(NSString *)locale andClientID:(NSString *)clientID andClientSecret:(NSString *)clientSecret success:(WordPressComServiceSuccessBlock)success @@ -45,7 +43,6 @@ typedef void(^WordPressComServiceFailureBlock)(NSError *error); @param failure failure block */ - (void)createWPComAccountWithGoogle:(NSString *)token - andLocale:(NSString *)locale andClientID:(NSString *)clientID andClientSecret:(NSString *)clientSecret success:(WordPressComServiceSuccessBlock)success diff --git a/WordPressKit/WordPressComServiceRemote.m b/WordPressKit/WordPressComServiceRemote.m index 80f0f34d..44ee95ea 100644 --- a/WordPressKit/WordPressComServiceRemote.m +++ b/WordPressKit/WordPressComServiceRemote.m @@ -8,7 +8,6 @@ @implementation WordPressComServiceRemote - (void)createWPComAccountWithEmail:(NSString *)email andUsername:(NSString *)username andPassword:(NSString *)password - andLocale:(NSString *)locale andClientID:(NSString *)clientID andClientSecret:(NSString *)clientSecret success:(WordPressComServiceSuccessBlock)success @@ -21,7 +20,6 @@ - (void)createWPComAccountWithEmail:(NSString *)email [self createWPComAccountWithEmail:email andUsername:username andPassword:password - andLocale:locale andClientID:clientID andClientSecret:clientSecret validate:NO @@ -32,7 +30,6 @@ - (void)createWPComAccountWithEmail:(NSString *)email - (void)createWPComAccountWithEmail:(NSString *)email andUsername:(NSString *)username andPassword:(NSString *)password - andLocale:(NSString *)locale andClientID:(NSString *)clientID andClientSecret:(NSString *)clientSecret validate:(BOOL)validate @@ -57,7 +54,6 @@ - (void)createWPComAccountWithEmail:(NSString *)email @"username": username, @"password": password, @"validate": @(validate), - @"locale": locale, @"client_id": clientID, @"client_secret": clientSecret }; @@ -70,7 +66,6 @@ - (void)createWPComAccountWithEmail:(NSString *)email // API v1 POST /users/social/new - (void)createWPComAccountWithGoogle:(NSString *)token - andLocale:(NSString *)locale andClientID:(NSString *)clientID andClientSecret:(NSString *)clientSecret success:(WordPressComServiceSuccessBlock)success @@ -89,7 +84,6 @@ - (void)createWPComAccountWithGoogle:(NSString *)token @"client_id": clientID, @"client_secret": clientSecret, @"id_token": token, - @"locale": locale, @"service": @"google", @"signup_flow_name": @"social", }; diff --git a/WordPressKitTests/WordPressComServiceRemoteRestTests.swift b/WordPressKitTests/WordPressComServiceRemoteRestTests.swift index eb14f71d..173bf05f 100644 --- a/WordPressKitTests/WordPressComServiceRemoteRestTests.swift +++ b/WordPressKitTests/WordPressComServiceRemoteRestTests.swift @@ -53,7 +53,6 @@ class WordPressComServiceRemoteRestTests: XCTestCase { service.createWPComAccount(withEmail: "fakeEmail", andUsername: "fakeUsername", andPassword: "fakePassword", - andLocale: "en", andClientID: "moo", andClientSecret: "cow", success: { (responseObject) in