27
27
#import " FIRGitHubAuthProvider.h"
28
28
#import " FIRGoogleAuthProvider.h"
29
29
#import " FIROAuthProvider.h"
30
+
31
+ #if FIREBASE_PLATFORM_IOS
30
32
#import " FIRPhoneAuthProvider.h"
33
+ #endif
34
+
31
35
#import " FIRTwitterAuthProvider.h"
32
36
33
37
// This object is shared between the PhoneAuthProvider::Listener and the blocks in
@@ -219,6 +223,7 @@ @implementation PhoneListenerDataObjC
219
223
return localPlayer.isAuthenticated ;
220
224
}
221
225
226
+ #if FIREBASE_PLATFORM_IOS
222
227
// We skip the implementation of ForceResendingTokenData since it is not needed.
223
228
// The ForceResendingToken class for iOS is empty.
224
229
PhoneAuthProvider::ForceResendingToken::ForceResendingToken ()
@@ -325,6 +330,7 @@ explicit PhoneAuthProviderData(FIRPhoneAuthProvider* objc_provider)
325
330
}
326
331
return provider;
327
332
}
333
+ #endif // FIREBASE_PLATFORM_IOS
328
334
329
335
// FederatedAuthHandlers
330
336
FederatedOAuthProvider::FederatedOAuthProvider () { }
@@ -420,6 +426,7 @@ void ReauthenticateWithProviderGetCredentialCallback(FIRAuthCredential* _Nullabl
420
426
ReferenceCountedFutureImpl &futures = auth_data->future_impl ;
421
427
auto handle =
422
428
futures.SafeAlloc <SignInResult>(kUserFn_LinkWithProvider , SignInResult ());
429
+ #if FIREBASE_PLATFORM_IOS
423
430
FIROAuthProvider* ios_provider = (FIROAuthProvider*)[FIROAuthProvider
424
431
providerWithProviderID: @(provider_data_.provider_id.c_str ())
425
432
auth: AuthImpl (auth_data)];
@@ -442,13 +449,21 @@ void ReauthenticateWithProviderGetCredentialCallback(FIRAuthCredential* _Nullabl
442
449
SignInResult ());
443
450
return future;
444
451
}
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
+
445
459
}
446
460
447
461
Future<SignInResult> FederatedOAuthProvider::Reauthenticate (AuthData* auth_data) {
448
462
assert (auth_data);
449
463
ReferenceCountedFutureImpl &futures = auth_data->future_impl ;
450
464
auto handle =
451
465
futures.SafeAlloc <SignInResult>(kUserFn_LinkWithProvider , SignInResult ());
466
+ #if FIREBASE_PLATFORM_IOS
452
467
FIROAuthProvider* ios_provider = (FIROAuthProvider*)[FIROAuthProvider
453
468
providerWithProviderID: @(provider_data_.provider_id.c_str ())
454
469
auth: AuthImpl (auth_data)];
@@ -471,6 +486,12 @@ void ReauthenticateWithProviderGetCredentialCallback(FIRAuthCredential* _Nullabl
471
486
SignInResult ());
472
487
return future;
473
488
}
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
474
495
}
475
496
476
497
} // namespace auth
0 commit comments