mirror of
https://github.com/firebase/firebase-ios-sdk
synced 2026-11-09 22:36:01 +05:45
Revert "Revert "Migrate from using IID SDK for Remote Config to the new FIS SDK (#5096)" (#5156)" (#5367)
This reverts commit 230d56260f.
This commit is contained in:
1 parent
7b78ac7866
commit
3576a305fe
8 files changed
+148
-145
No files matched your search
@@ -17,7 +17,7 @@
|
||||
#import <FirebaseAnalytics/FirebaseAnalytics.h>
|
||||
#import <FirebaseCore/FIROptions.h>
|
||||
#import <FirebaseCore/FirebaseCore.h>
|
||||
#import <FirebaseInstanceID/FIRInstanceID+Private.h>
|
||||
#import <FirebaseInstallations/FirebaseInstallations.h>
|
||||
#import <FirebaseRemoteConfig/FIRRemoteConfig_Private.h>
|
||||
#import <FirebaseRemoteConfig/FirebaseRemoteConfig.h>
|
||||
#import "FRCLog.h"
|
||||
@@ -355,21 +355,19 @@ static NSString *const FIRSecondFIRAppName = @"secondFIRApp";
|
||||
stringWithFormat:@"%@\n",
|
||||
[self statusString:currentRCInstance.lastFetchStatus]]];
|
||||
|
||||
FIRInstanceID *instanceID = [FIRInstanceID instanceID];
|
||||
[instanceID getIDWithHandler:^(NSString *_Nullable identity, NSError *_Nullable error) {
|
||||
[output appendString:@"\n-----------Instance ID------------------\n"];
|
||||
[output appendString:[NSString stringWithFormat:@"%@\n", identity]];
|
||||
FIRInstallations *installations = [FIRInstallations installations];
|
||||
[installations installationIDWithCompletion:^(NSString *_Nullable identifier,
|
||||
NSError *_Nullable error) {
|
||||
[output appendString:@"\n-----------Installation ID------------------\n"];
|
||||
[output appendString:[NSString stringWithFormat:@"%@\n", identifier]];
|
||||
|
||||
[output appendString:@"\n-----------Instance ID token------------\n"];
|
||||
[output
|
||||
appendString:[NSString stringWithFormat:@"%@\n",
|
||||
currentRCInstance.settings.configInstanceIDToken]];
|
||||
[output appendString:@"\n-----------Installation ID token------------\n"];
|
||||
|
||||
[output appendString:@"\n-----------Android ID------------\n"];
|
||||
[output
|
||||
appendString:[NSString stringWithFormat:@"%@\n", currentRCInstance.settings.deviceAuthID]];
|
||||
|
||||
[[FRCLog sharedInstance] logToConsole:output];
|
||||
[installations authTokenWithCompletion:^(FIRInstallationsAuthTokenResult *_Nullable tokenResult,
|
||||
NSError *_Nullable error) {
|
||||
[output appendString:[NSString stringWithFormat:@"%@\n", tokenResult.authToken]];
|
||||
[[FRCLog sharedInstance] logToConsole:output];
|
||||
}];
|
||||
}];
|
||||
}
|
||||
|
||||
@@ -409,27 +407,28 @@ static NSString *const FIRSecondFIRAppName = @"secondFIRApp";
|
||||
}
|
||||
|
||||
- (IBAction)fetchIIDButtonClicked:(id)sender {
|
||||
FIRInstanceID *instanceID = [FIRInstanceID instanceID];
|
||||
FIRInstanceIDTokenHandler instanceIDHandler = ^(NSString *token, NSError *error) {
|
||||
FIRInstallations *installations =
|
||||
[FIRInstallations installationsWithApp:[FIRApp appNamed:self.FIRAppName]];
|
||||
[installations installationIDWithCompletion:^(NSString *_Nullable identifier,
|
||||
NSError *_Nullable error) {
|
||||
if (error) {
|
||||
[[FRCLog sharedInstance] logToConsole:[NSString stringWithFormat:@"%@", error]];
|
||||
}
|
||||
if (token) {
|
||||
((FIRRemoteConfig *)self.RCInstances[self.currentNamespace][self.FIRAppName])
|
||||
.settings.configInstanceIDToken = token;
|
||||
[instanceID getIDWithHandler:^(NSString *_Nullable identity, NSError *_Nullable error) {
|
||||
[[FRCLog sharedInstance]
|
||||
logToConsole:[NSString
|
||||
stringWithFormat:
|
||||
@"Successfully getting InstanceID : \n\n%@\n\nToken : \n\n%@\n",
|
||||
identity, token]];
|
||||
} else {
|
||||
[installations authTokenWithCompletion:^(
|
||||
FIRInstallationsAuthTokenResult *_Nullable tokenResult,
|
||||
NSError *_Nullable error) {
|
||||
if (tokenResult.authToken) {
|
||||
((FIRRemoteConfig *)self.RCInstances[self.currentNamespace][self.FIRAppName])
|
||||
.settings.configInstallationsToken = tokenResult.authToken;
|
||||
[[FRCLog sharedInstance]
|
||||
logToConsole:[NSString
|
||||
stringWithFormat:
|
||||
@"Successfully got installation ID : \n\n%@\n\nToken : \n\n%@\n",
|
||||
identifier, tokenResult.authToken]];
|
||||
}
|
||||
}];
|
||||
}
|
||||
};
|
||||
[instanceID tokenWithAuthorizedEntity:[FIRApp appNamed:self.FIRAppName].options.GCMSenderID
|
||||
scope:@"*"
|
||||
options:nil
|
||||
handler:instanceIDHandler];
|
||||
}];
|
||||
}
|
||||
|
||||
- (IBAction)searchButtonClicked:(id)sender {
|
||||
|
||||
Reference in new issue
Block a user