Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions FirebaseRemoteConfig.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
Pod::Spec.new do |s|
s.name = 'FirebaseRemoteConfig'
s.version = '4.4.0'
s.summary = 'Firebase RemoteConfig for iOS'

s.description = <<-DESC
Firebase Remote Config is a cloud service that lets you change the
appearance and behavior of your app without requiring users to download an
app update.
DESC

s.homepage = 'https://firebase.google.com'
s.license = { :type => 'Apache', :file => 'LICENSE' }
s.authors = 'Google, Inc.'

s.source = {
:git => 'https://github.com/firebase/firebase-ios-sdk.git',
:tag => 'RemoteConfig-' + s.version.to_s
}
s.social_media_url = 'https://twitter.com/Firebase'
s.ios.deployment_target = '8.0'
s.osx.deployment_target = '10.11'
s.tvos.deployment_target = '10.0'

s.cocoapods_version = '>= 1.4.0'
s.static_framework = true
s.prefix_header_file = false

base_dir = "FirebaseRemoteConfig/Sources/"
s.source_files = base_dir + '**/*.[mh]'
s.requires_arc = base_dir + '*.m'
s.public_header_files = base_dir + 'Public/*.h'
s.pod_target_xcconfig = {
'GCC_C_LANGUAGE_STANDARD' => 'c99',
'GCC_PREPROCESSOR_DEFINITIONS' =>
'GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1 ' +
'FIRRemoteConfig_VERSION=' + String(s.version),
'HEADER_SEARCH_PATHS' => '"${PODS_TARGET_SRCROOT}"'
}
s.dependency 'FirebaseAnalyticsInterop', '~> 1.4'
s.dependency 'FirebaseABTesting', '~> 3.1'
s.dependency 'FirebaseCore', '~> 6.2'
s.dependency 'FirebaseInstanceID', '~> 4.2'
s.dependency 'GoogleUtilities/Environment', '~> 6.2'
s.dependency 'GoogleUtilities/NSData+zlib', '~> 6.2'
s.dependency 'Protobuf', '~> 3.9'

s.test_spec 'unit' do |unit_tests|
# TODO(dmandar) - Update or delete the commented files.
unit_tests.source_files =
'FirebaseRemoteConfig/Tests/Unit/FIRRemoteConfigComponentTest.m',
'FirebaseRemoteConfig/Tests/Unit/RCNConfigContentTest.m',
'FirebaseRemoteConfig/Tests/Unit/RCNConfigDBManagerTest.m',
# 'FirebaseRemoteConfig/Tests/Unit/RCNConfigSettingsTest.m',
# 'FirebaseRemoteConfig/Tests/Unit/RCNConfigTest.m',
'FirebaseRemoteConfig/Tests/Unit/RCNConfigExperimentTest.m',
'FirebaseRemoteConfig/Tests/Unit/RCNConfigValueTest.m',
# 'FirebaseRemoteConfig/Tests/Unit/RCNRemoteConfig+FIRAppTest.m',
'FirebaseRemoteConfig/Tests/Unit/RCNRemoteConfigTest.m',
# 'FirebaseRemoteConfig/Tests/Unit/RCNThrottlingTests.m',
'FirebaseRemoteConfig/Tests/Unit/RCNTestUtilities.m',
'FirebaseRemoteConfig/Tests/Unit/RCNUserDefaultsManagerTests.m'
# Supply plist custom plist testing.
unit_tests.resources =
'FirebaseRemoteConfig/Tests/Unit/Defaults-testInfo.plist',
'FirebaseRemoteConfig/Tests/Unit/SecondApp-GoogleService-Info.plist'
unit_tests.requires_app_host = true
unit_tests.dependency 'OCMock'
end
end
127 changes: 127 additions & 0 deletions FirebaseRemoteConfig/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
Version 4.3.0
==================================
- Open source. (TBD)
- Community macOS (#1674) and tvOS support.
- Catalyst build support.

Version 4.2.2
==================================
- Bug fix for a crash seen by some users (#3508)
- Internal changes and stability improvements.

Version 4.2.1
==================================
- Bug fix for a crash seen by some users. (#3344)

Version 4.2.0
==================================
- Improved shared instance initialization sequence during 'FirebaseApp.configure()'.

Version 4.1.0
==================================
- Async initialization with new API for ensuring initialization completed with completion handler.
- Support for multiple active instances of Remote Config in the same app (Analytics only supported with default Firebase app instance).
- All Remote Config API with explicit namespace are deprecated.
- New fetchAndActivate API to perform both fetch and activation upon a successful fetch in a single API call with async completion.
- New property in the FIRRemoteConfigValue class for reading value of a param as a jsonValue.
- developerModeEnabled is now deprecated. Use minimumFetchInterval or call fetchWithExpirationDuration: to force a fetch to the Remote Config backend.
- New config settings for minimumFetchInterval and fetch timeout.
- Async activate API with completion handler.

Version 4.0.0
==================================
- FirebaseAnalytics is no longer a hard dependency in the RemoteConfig pod. If you were installing Remote Config via pod ''Firebase/RemoteConfig'', you should add 'pod 'Firebase/Analytics'' to the Podfile to maintain full RemoteConfig functionality. If you previously have 'pod 'Firebase/Core'' in the Podfile, no change is necessary. No major changes to functionality.

Version 3.1.0
==================================
- Internal changes to support the new version of Firebase Performance SDK.

Version 3.0.2
==================================
- Bug fixes.

Version 3.0.1
==================================
- Bug fix for a memory leak bug. (#488)


Version 3.0.0
==================================
- Change the designated initializer for FIRRemoteConfigSettings to return a nonnull FIRRemoteConfigSettings object.

Version 2.1.3
==================================
- Improve documentation on GDPR usage.

Version 2.1.2
==================================
- Improve language targeting. Simplied Chinese (zh_hans) and Traditional Chinese (Taiwan) (zh_TW) language targeting should also be more accurate.

Version 2.1.1
==================================
- Fix an issue that throttle rate drops during developer mode.
- Replaced FIR_SWIFT_NAME with NS_SWIFT_NAME.

Version 2.1.0
==================================
- Add ABTesting feature to allow developers to run experiments using Remote Config.

Version 2.0.3
==================================
- Resolved an issue that config values are not updating correctly when targeted by a user property condition.

Version 2.0.2
==================================
- Fix an issue that prevent app from crashing when main bundle ID is missing. Also notify developers remote config might not work if main bundle ID is missing.

Version 2.0.1
==================================
- Add a warning message if a plist file can't be found when setting default values from it.
- Internal clean up removing code for testing that is no longer used.

Version 2.0.0
==================================
- Change Swift API names to better align with Swift convention.
- Change Error message to debug message when getting InstanceID operation is in progress as this is an expected behavior.

Version 1.3.4
==================================
- Fix the issue with Remote Config getting an incorrect configuration when user configured multiple projects.
- Fix the issue with existing users getting empty config results.

Version 1.3.3
==================================
- Switches to the new Protobuf from ProtocolBuffers2.

Version 1.3.2
==================================
Resolved Issues:
- Fix an issue that activateFetched called when app starts will remove cached results.
- Fix an issue that multiple fetches without activateFetched will not get recent changes.

Version 1.3.1
==================================
Resolved Issues:
- Better documentation on the public headers.

Version 1.3.0
==================================
Features:
- Support user property targeting for analytics abilities.

Resolved Issues:
- Fix critical crashes due to concurrent fetches, make it more thread safe.

Version 1.2.0
==================================
Features:
- Add two new API methods to allow developers to get all the keys based on a key prefix.

Resolved Issues:
- Fix a crash issue during fetching config.
- Clarify the confusion on the documents of activateFetched method.
- Correct the cast error in the comment of remoteConfig method.

Version 1.1.1
==================================
Initial release in Google I/O 2016.
11 changes: 11 additions & 0 deletions FirebaseRemoteConfig/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Firebase Remote Config SDK for iOS

This pod contains the Firebase Remote Config SDK for iOS, supporting both
Objective-C and Swift.

Firebase Remote Config is a cloud service that lets you change the appearance
and behavior of your app without requiring users to download an app update.

Please visit [our developer site]
(https://firebase.google.com/docs/remote-config/) for integration instructions,
documentation, support information, and terms of service.
91 changes: 91 additions & 0 deletions FirebaseRemoteConfig/Sources/FIRConfigValue.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
/*
* Copyright 2019 Google
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#import <FirebaseRemoteConfig/FIRRemoteConfig.h>

#import <FirebaseCore/FIRLogger.h>
#import "FirebaseRemoteConfig/Sources/RCNConfigValue_Internal.h"

@implementation FIRRemoteConfigValue {
/// Data backing the config value.
NSData *_data;
FIRRemoteConfigSource _source;
}

/// Designated initializer
- (instancetype)initWithData:(NSData *)data source:(FIRRemoteConfigSource)source {
self = [super init];
if (self) {
_data = [data copy];
_source = source;
}
return self;
}

/// Superclass's designated initializer
- (instancetype)init {
return [self initWithData:nil source:FIRRemoteConfigSourceStatic];
}

/// The string is a UTF-8 representation of NSData.
- (NSString *)stringValue {
return [[NSString alloc] initWithData:_data encoding:NSUTF8StringEncoding];
}

/// Number representation of a UTF-8 string.
- (NSNumber *)numberValue {
return [NSNumber numberWithDouble:self.stringValue.doubleValue];
}

/// Internal representation of the FIRRemoteConfigValue as a NSData object.
- (NSData *)dataValue {
return _data;
}

/// Boolean representation of a UTF-8 string.
- (BOOL)boolValue {
return self.stringValue.boolValue;
}

/// Returns a foundation object (NSDictionary / NSArray) representation for JSON data.
- (id)JSONValue {
NSError *error;
if (!_data) {
return nil;
}
id JSONObject = [NSJSONSerialization JSONObjectWithData:_data options:kNilOptions error:&error];
if (error) {
FIRLogDebug(kFIRLoggerRemoteConfig, @"I-RCN000065", @"Error parsing data as JSON.");
return nil;
}
return JSONObject;
}

/// Debug description showing the representations of all types.
- (NSString *)debugDescription {
NSString *content = [NSString
stringWithFormat:@"Boolean: %d, String: %@, Number: %@, JSON:%@, Data: %@, Source: %zd",
self.boolValue, self.stringValue, self.numberValue, self.JSONValue, _data,
(long)self.source];
return [NSString stringWithFormat:@"<%@: %p, %@>", [self class], self, content];
}

/// Copy method.
- (id)copyWithZone:(NSZone *)zone {
FIRRemoteConfigValue *value = [[[self class] allocWithZone:zone] initWithData:_data];
return value;
}
@end
Loading