2727#import " FIRGitHubAuthProvider.h"
2828#import " FIRGoogleAuthProvider.h"
2929#import " FIROAuthProvider.h"
30+
31+ #if FIREBASE_PLATFORM_IOS
3032#import " FIRPhoneAuthProvider.h"
33+ #endif
34+
3135#import " FIRTwitterAuthProvider.h"
3236
3337// This object is shared between the PhoneAuthProvider::Listener and the blocks in
@@ -219,6 +223,7 @@ @implementation PhoneListenerDataObjC
219223 return localPlayer.isAuthenticated ;
220224}
221225
226+ #if FIREBASE_PLATFORM_IOS
222227// We skip the implementation of ForceResendingTokenData since it is not needed.
223228// The ForceResendingToken class for iOS is empty.
224229PhoneAuthProvider::ForceResendingToken::ForceResendingToken ()
@@ -325,6 +330,7 @@ explicit PhoneAuthProviderData(FIRPhoneAuthProvider* objc_provider)
325330 }
326331 return provider;
327332}
333+ #endif // FIREBASE_PLATFORM_IOS
328334
329335// FederatedAuthHandlers
330336FederatedOAuthProvider::FederatedOAuthProvider () { }
@@ -420,6 +426,7 @@ void ReauthenticateWithProviderGetCredentialCallback(FIRAuthCredential* _Nullabl
420426 ReferenceCountedFutureImpl &futures = auth_data->future_impl ;
421427 auto handle =
422428 futures.SafeAlloc <SignInResult>(kUserFn_LinkWithProvider , SignInResult ());
429+ #if FIREBASE_PLATFORM_IOS
423430 FIROAuthProvider* ios_provider = (FIROAuthProvider*)[FIROAuthProvider
424431 providerWithProviderID: @(provider_data_.provider_id.c_str ())
425432 auth: AuthImpl (auth_data)];
@@ -442,13 +449,21 @@ void ReauthenticateWithProviderGetCredentialCallback(FIRAuthCredential* _Nullabl
442449 SignInResult ());
443450 return future;
444451 }
452+
453+ #else // non iOS Apple platform
454+ Future<SignInResult> future = MakeFuture (&futures, handle);
455+ futures.Complete (handle, kAuthErrorApiNotAvailable ,
456+ " Link with getCredentialWithUIDelegate is not supported on non-iOS Apple platforms." );
457+ #endif // FIREBASE_PLATFORM_IOS
458+
445459}
446460
447461Future<SignInResult> FederatedOAuthProvider::Reauthenticate (AuthData* auth_data) {
448462 assert (auth_data);
449463 ReferenceCountedFutureImpl &futures = auth_data->future_impl ;
450464 auto handle =
451465 futures.SafeAlloc <SignInResult>(kUserFn_LinkWithProvider , SignInResult ());
466+ #if FIREBASE_PLATFORM_IOS
452467 FIROAuthProvider* ios_provider = (FIROAuthProvider*)[FIROAuthProvider
453468 providerWithProviderID: @(provider_data_.provider_id.c_str ())
454469 auth: AuthImpl (auth_data)];
@@ -471,6 +486,12 @@ void ReauthenticateWithProviderGetCredentialCallback(FIRAuthCredential* _Nullabl
471486 SignInResult ());
472487 return future;
473488 }
489+
490+ #else // non iOS Apple Platform
491+ Future<SignInResult> future = MakeFuture (&futures, handle);
492+ futures.Complete (handle, kAuthErrorApiNotAvailable ,
493+ " Reauthenticate with getCredentialWithUIDelegate is not supported on non-iOS Apple platforms." );
494+ #endif // FIREBASE_PLATFORM_IOS
474495}
475496
476497} // namespace auth
0 commit comments