-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create Segmentation SDK structure for source and unit tests. (#3214)
* Create Segmentation SDK structure for source and unit tests. * Review changes: Remove unnecessary files in test folder. Add md-floc-master to CI * Rename Segmentation directory to FirebaseSegmentation directory. Update podspec to include search header path.
- Loading branch information
Showing
7 changed files
with
197 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
Pod::Spec.new do |s| | ||
s.name = 'FirebaseSegmentation' | ||
s.version = '0.1.0' | ||
s.summary = 'Firebase Segmentation SDK' | ||
s.description = <<-DESC | ||
Firebase Segmentation enables you to associate your custom application instance ID with Firebase for user segmentation. | ||
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 => 'Segmentation-' + s.version.to_s | ||
} | ||
|
||
s.ios.deployment_target = '8.0' | ||
|
||
s.cocoapods_version = '>= 1.4.0' | ||
s.static_framework = true | ||
s.prefix_header_file = false | ||
|
||
s.source_files = 'FirebaseSegmentation/Sources/**/*' | ||
s.public_header_files = 'FirebaseSegmentation/Public/*.h' | ||
|
||
s.dependency 'FirebaseCore', '~> 6.0' | ||
s.dependency 'FirebaseInstanceID', '~> 4.2' | ||
|
||
header_search_paths = { | ||
'HEADER_SEARCH_PATHS' => '"${PODS_TARGET_SRCROOT}"' | ||
} | ||
|
||
s.user_target_xcconfig = { 'FRAMEWORK_SEARCH_PATHS' => '$(PLATFORM_DIR)/Developer/Library/Frameworks' } | ||
|
||
s.pod_target_xcconfig = { | ||
'GCC_C_LANGUAGE_STANDARD' => 'c99', | ||
'GCC_PREPROCESSOR_DEFINITIONS' => 'FIRSegmentation_VERSION=' + s.version.to_s | ||
} | ||
|
||
s.test_spec 'unit' do |unit_tests| | ||
unit_tests.source_files = 'FirebaseSegmentation/Tests/Unit/*.[mh]' | ||
unit_tests.dependency 'OCMock' | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* | ||
* 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 <Foundation/Foundation.h> | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
@class FIRApp; | ||
/** | ||
* The Firebase Segmentation SDK is used to associate a custom, non-Firebase custom installation | ||
* identifier to Firebase. Once this custom installation identifier is set, developers can use the | ||
* current app installation for segmentation purposes. If the custom installation identifier is | ||
* explicitely set to nil, any existing custom installation identifier data will be removed. | ||
*/ | ||
NS_SWIFT_NAME(Segmentation) | ||
@interface FIRSegmentation : NSObject | ||
|
||
/** | ||
* Singleton instance (scoped to the default FIRApp) | ||
* Returns the FIRSegmentation instance for the default Firebase application. Please make sure you | ||
* call [FIRApp configure] beforehand for a default Firebase app to already be initialized and | ||
* available. This singleton class instance lets you set your own custom identifier to be used for | ||
* user segmentation purposes within Firebase. | ||
* | ||
* @return A shared instance of FIRSegmentation. | ||
*/ | ||
+ (nonnull FIRSegmentation *)segmentation NS_SWIFT_NAME(segmentation()); | ||
|
||
/// Singleton instance (scoped to FIRApp) | ||
/// Returns the FIRSegmentation instance for your Firebase application. This singleton class | ||
/// instance lets you set your own custom identifier to be used for targeting purposes within | ||
/// Firebase. | ||
+ (nonnull FIRSegmentation *)segmentationWithApp:(nonnull FIRApp *)app | ||
NS_SWIFT_NAME(segmentation(app:)); | ||
|
||
/** | ||
* Unavailable. Use +segmentation instead. | ||
*/ | ||
- (instancetype)init __attribute__((unavailable("Use +segmentation instead."))); | ||
|
||
/// Set your own custom installation ID to be used for segmentation purposes. | ||
/// This method needs to be called every time (and immediately) upon any changes to the custom | ||
/// installation ID. | ||
/// @param completionHandler Set custom installation ID completion. Returns nil if initialization | ||
/// succeeded or an NSError object if initialization failed. | ||
- (void)setCustomInstallationID:(NSString *)customInstallationID | ||
completion:(void (^)(NSError *))completionHandler; | ||
|
||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* | ||
* 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 "FIRSegmentation.h" |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// 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 "FIRSegmentation.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// 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 <XCTest/XCTest.h> | ||
|
||
@interface SEGInitializationTests : XCTestCase | ||
|
||
@end | ||
|
||
@implementation SEGInitializationTests | ||
|
||
- (void)setUp { | ||
// Put setup code here. This method is called before the invocation of each test method in the | ||
// class. | ||
} | ||
|
||
- (void)tearDown { | ||
// Put teardown code here. This method is called after the invocation of each test method in the | ||
// class. | ||
} | ||
|
||
- (void)testExample { | ||
NSLog(@"this is a test example"); | ||
// This is an example of a functional test case. | ||
// Use XCTAssert and related functions to verify your tests produce the correct results. | ||
} | ||
|
||
- (void)testPerformanceExample { | ||
// This is an example of a performance test case. | ||
[self measureBlock:^{ | ||
// Put the code you want to measure the time of here. | ||
}]; | ||
} | ||
|
||
@end |