Skip to content

Commit

Permalink
Merge pull request #22 from Flagsmith/release/3.0.0
Browse files Browse the repository at this point in the history
Release/3.0.0
  • Loading branch information
matthewelwell authored Jun 7, 2022
2 parents 335ec52 + 8256560 commit 95195e3
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion FlagsmithClient.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'FlagsmithClient'
s.version = '2.1.0'
s.version = '3.0.0'
s.summary = 'iOS Client written in Swift for Flagsmith. Ship features with confidence using feature flags and remote config.'
s.homepage = 'https://github.com/Flagsmith/flagsmith-ios-client'
s.license = { :type => 'MIT', :file => 'LICENSE' }
Expand Down
2 changes: 1 addition & 1 deletion FlagsmithClient/Classes/Flagsmith.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class Flagsmith {

/// Base URL
///
/// The default implementation uses: `https://api.flagsmith.com/api/v1`.
/// The default implementation uses: `https://edge.api.flagsmith.com/api/v1`.
public var baseURL: URL {
set { apiManager.baseURL = newValue }
get { apiManager.baseURL }
Expand Down
2 changes: 1 addition & 1 deletion FlagsmithClient/Classes/Internal/APIManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class APIManager {
private let session: URLSession

/// Base `URL` used for requests.
var baseURL = URL(string: "https://api.flagsmith.com/api/v1/")!
var baseURL = URL(string: "https://edge.api.flagsmith.com/api/v1/")!
/// API Key unique to an organization.
var apiKey: String?

Expand Down
10 changes: 5 additions & 5 deletions FlagsmithClient/Tests/RouterTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ import XCTest

final class RouterTests: FlagsmithClientTestCase {

let baseUrl = URL(string: "https://api.flagsmith.com/api/v1")
let baseUrl = URL(string: "https://edge.api.flagsmith.com/api/v1")
let apiKey = "E71DC632-82BA-4522-82F3-D39FB6DC90AC"

func testGetFlagsRequest() throws {
let url = try XCTUnwrap(baseUrl)
let route = Router.getFlags
let request = try route.request(baseUrl: url, apiKey: apiKey)
XCTAssertEqual(request.httpMethod, "GET")
XCTAssertEqual(request.url?.absoluteString, "https://api.flagsmith.com/api/v1/flags/")
XCTAssertEqual(request.url?.absoluteString, "https://edge.api.flagsmith.com/api/v1/flags/")
XCTAssertTrue(request.allHTTPHeaderFields?.contains(where: { $0.key == "X-Environment-Key" }) ?? false)
XCTAssertNil(request.httpBody)
}
Expand All @@ -28,7 +28,7 @@ final class RouterTests: FlagsmithClientTestCase {
let route = Router.getIdentity(identity: "6056BCBF")
let request = try route.request(baseUrl: url, apiKey: apiKey)
XCTAssertEqual(request.httpMethod, "GET")
XCTAssertEqual(request.url?.absoluteString, "https://api.flagsmith.com/api/v1/identities/?identifier=6056BCBF")
XCTAssertEqual(request.url?.absoluteString, "https://edge.api.flagsmith.com/api/v1/identities/?identifier=6056BCBF")
XCTAssertTrue(request.allHTTPHeaderFields?.contains(where: { $0.key == "X-Environment-Key" }) ?? false)
XCTAssertNil(request.httpBody)
}
Expand All @@ -39,7 +39,7 @@ final class RouterTests: FlagsmithClientTestCase {
let route = Router.postTrait(trait: trait, identity: "CFF8D9CA")
let request = try route.request(baseUrl: url, apiKey: apiKey, using: encoder)
XCTAssertEqual(request.httpMethod, "POST")
XCTAssertEqual(request.url?.absoluteString, "https://api.flagsmith.com/api/v1/traits/")
XCTAssertEqual(request.url?.absoluteString, "https://edge.api.flagsmith.com/api/v1/traits/")

let json = """
{
Expand All @@ -66,7 +66,7 @@ final class RouterTests: FlagsmithClientTestCase {
let request = try route.request(baseUrl: url, apiKey: apiKey, using: encoder)

XCTAssertEqual(request.httpMethod, "POST")
XCTAssertEqual(request.url?.absoluteString, "https://api.flagsmith.com/api/v1/analytics/flags/")
XCTAssertEqual(request.url?.absoluteString, "https://edge.api.flagsmith.com/api/v1/analytics/flags/")

let json = """
{
Expand Down

0 comments on commit 95195e3

Please sign in to comment.