2018-09-19 12:08:51 -07:00
|
|
|
/*
|
|
|
|
|
* Copyright 2018 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.
|
|
|
|
|
*/
|
|
|
|
|
|
2020-08-11 07:44:06 -07:00
|
|
|
#import <TargetConditionals.h>
|
|
|
|
|
#if TARGET_OS_IOS
|
|
|
|
|
|
2020-01-30 11:44:31 -08:00
|
|
|
#import "FirebaseDynamicLinks/Sources/FDLURLComponents/FIRDynamicLinkComponentsKeyProvider.h"
|
2018-09-19 12:08:51 -07:00
|
|
|
|
2020-06-09 05:21:28 -07:00
|
|
|
#import "FirebaseCore/Sources/Private/FirebaseCoreInternal.h"
|
2018-09-19 12:08:51 -07:00
|
|
|
|
|
|
|
|
@implementation FIRDynamicLinkComponentsKeyProvider
|
|
|
|
|
|
2018-11-27 16:56:46 -05:00
|
|
|
+ (nullable NSString *)APIKey {
|
|
|
|
|
// If there's no default app, immediately return nil since reading from the default app will cause
|
|
|
|
|
// an error to be logged.
|
|
|
|
|
if (![FIRApp isDefaultAppConfigured]) {
|
|
|
|
|
return nil;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// FDL only supports the default app, use the options from it.
|
|
|
|
|
return [FIRApp defaultApp].options.APIKey;
|
2018-09-19 12:08:51 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@end
|
2020-08-11 07:44:06 -07:00
|
|
|
|
|
|
|
|
#endif // TARGET_OS_IOS
|