Giter Site home page Giter Site logo

firebase / firebase-ios-sdk Goto Github PK

View Code? Open in Web Editor NEW
5.2K 220.0 1.4K 65.07 MB

Firebase SDK for Apple App Development

Home Page: https://firebase.google.com

License: Apache License 2.0

Objective-C 44.21% Ruby 0.79% C 1.55% Swift 10.24% Shell 0.58% Objective-C++ 4.24% C++ 37.29% Python 0.62% CMake 0.40% JavaScript 0.02% sed 0.01% HCL 0.05%
firebase ios-sdk objective-c database-as-a-service push-notifications storage-service authentication firebase-database firebase-auth firebase-authentication

firebase-ios-sdk's Introduction


Firebase Apple Open Source Development

This repository contains the source code for all Apple platform Firebase SDKs except FirebaseAnalytics.

Firebase is an app development platform with tools to help you build, grow, and monetize your app. More information about Firebase can be found on the official Firebase website.

Installation

See the subsections below for details about the different installation methods. Where available, it's recommended to install any libraries with a Swift suffix to get the best experience when writing your app in Swift.

  1. Standard pod install
  2. Swift Package Manager
  3. Installing from the GitHub repo
  4. Experimental Carthage

Standard pod install

For instructions on the standard pod install, visit: https://firebase.google.com/docs/ios/setup.

Swift Package Manager

Instructions for Swift Package Manager support can be found in the SwiftPackageManager.md Markdown file.

Installing from GitHub

These instructions can be used to access the Firebase repo at other branches, tags, or commits.

Background

See the Podfile Syntax Reference for instructions and options about overriding pod source locations.

Accessing Firebase Source Snapshots

All official releases are tagged in this repo and available via CocoaPods. To access a local source snapshot or unreleased branch, use Podfile directives like the following:

To access FirebaseFirestore via a branch:

pod 'FirebaseCore', :git => 'https://github.com/firebase/firebase-ios-sdk.git', :branch => 'main'
pod 'FirebaseFirestore', :git => 'https://github.com/firebase/firebase-ios-sdk.git', :branch => 'main'

To access FirebaseMessaging via a checked-out version of the firebase-ios-sdk repo:

pod 'FirebaseCore', :path => '/path/to/firebase-ios-sdk'
pod 'FirebaseMessaging', :path => '/path/to/firebase-ios-sdk'

Carthage (iOS only)

Instructions for the experimental Carthage distribution can be found at Carthage.md.

Using Firebase from a Framework or a library

For details on using Firebase from a Framework or a library, refer to firebase_in_libraries.md.

Development

To develop Firebase software in this repository, ensure that you have at least the following software:

  • Xcode 15.2 (or later)

CocoaPods is still the canonical way to develop, but much of the repo now supports development with Swift Package Manager.

CocoaPods

Install the following:

For the pod that you want to develop:

pod gen Firebase{name here}.podspec --local-sources=./ --auto-open --platforms=ios

Note: If the CocoaPods cache is out of date, you may need to run pod repo update before the pod gen command.

Note: Set the --platforms option to macos or tvos to develop/test for those platforms. Since 10.2, Xcode does not properly handle multi-platform CocoaPods workspaces.

Firestore has a self-contained Xcode project. See Firestore/README Markdown file.

Development for Catalyst

  • pod gen {name here}.podspec --local-sources=./ --auto-open --platforms=ios
  • Check the Mac box in the App-iOS Build Settings
  • Sign the App in the Settings Signing & Capabilities tab
  • Click Pods in the Project Manager
  • Add Signing to the iOS host app and unit test targets
  • Select the Unit-unit scheme
  • Run it to build and test

Alternatively, disable signing in each target:

  • Go to Build Settings tab
  • Click +
  • Select Add User-Defined Setting
  • Add CODE_SIGNING_REQUIRED setting with a value of NO

Swift Package Manager

  • To enable test schemes: ./scripts/setup_spm_tests.sh
  • open Package.swift or double click Package.swift in Finder.
  • Xcode will open the project
    • Choose a scheme for a library to build or test suite to run
    • Choose a target platform by selecting the run destination along with the scheme

Adding a New Firebase Pod

Refer to AddNewPod Markdown file for details.

Managing Headers and Imports

For information about managing headers and imports, see HeadersImports Markdown file.

Code Formatting

To ensure that the code is formatted consistently, run the script ./scripts/check.sh before creating a pull request (PR).

GitHub Actions will verify that any code changes are done in a style-compliant way. Install clang-format and mint:

brew install clang-format@18
brew install mint

Running Unit Tests

Select a scheme and press Command-u to build a component and run its unit tests.

Running Sample Apps

To run the sample apps and integration tests, you'll need a valid GoogleService-Info.plist file. The Firebase Xcode project contains dummy plist files without real values, but they can be replaced with real plist files. To get your own GoogleService-Info.plist files:

  1. Go to the Firebase Console
  2. Create a new Firebase project, if you don't already have one
  3. For each sample app you want to test, create a new Firebase app with the sample app's bundle identifier (e.g., com.google.Database-Example)
  4. Download the resulting GoogleService-Info.plist and add it to the Xcode project.

Coverage Report Generation

For coverage report generation instructions, see scripts/code_coverage_report/README Markdown file.

Specific Component Instructions

See the sections below for any special instructions for those components.

Firebase Auth

For specific Firebase Auth development, refer to the Auth Sample README for instructions about building and running the FirebaseAuth pod along with various samples and tests.

Firebase Database

The Firebase Database Integration tests can be run against a locally running Database Emulator or against a production instance.

To run against a local emulator instance, invoke ./scripts/run_database_emulator.sh start before running the integration test.

To run against a production instance, provide a valid GoogleServices-Info.plist and copy it to FirebaseDatabase/Tests/Resources/GoogleService-Info.plist. Your Security Rule must be set to public while your tests are running.

Firebase Dynamic Links

Firebase Dynamic Links is deprecated and should not be used in new projects. The service will shut down on August 25, 2025.

Please see our Dynamic Links Deprecation FAQ documentation for more guidance.

Firebase Performance Monitoring

For specific Firebase Performance Monitoring development, see the Performance README for instructions about building the SDK and the Performance TestApp README for instructions about integrating Performance with the dev test App.

Firebase Storage

To run the Storage Integration tests, follow the instructions in StorageIntegration.swift.

Push Notifications

Push notifications can only be delivered to specially provisioned App IDs in the developer portal. In order to test receiving push notifications, you will need to:

  1. Change the bundle identifier of the sample app to something you own in your Apple Developer account and enable that App ID for push notifications.
  2. You'll also need to upload your APNs Provider Authentication Key or certificate to the Firebase Console at Project Settings > Cloud Messaging > [Your Firebase App].
  3. Ensure your iOS device is added to your Apple Developer portal as a test device.

iOS Simulator

The iOS Simulator cannot register for remote notifications and will not receive push notifications. To receive push notifications, follow the steps above and run the app on a physical device.

Building with Firebase on Apple platforms

Firebase provides official beta support for macOS, Catalyst, and tvOS. visionOS and watchOS are community supported. Thanks to community contributions for many of the multi-platform PRs.

At this time, most of Firebase's products are available across Apple platforms. There are still a few gaps, especially on visionOS and watchOS. For details about the current support matrix, see this chart in Firebase's documentation.

visionOS

Where supported, visionOS works as expected with the exception of Firestore via Swift Package Manager where it is required to use the source distribution.

To enable the Firestore source distribution, quit Xcode and open the desired project from the command line with the FIREBASE_SOURCE_FIRESTORE environment variable: open --env FIREBASE_SOURCE_FIRESTORE /path/to/project.xcodeproj. To go back to using the binary distribution of Firestore, quit Xcode and open Xcode like normal, without the environment variable.

watchOS

Thanks to contributions from the community, many of Firebase SDKs now compile, run unit tests, and work on watchOS. See the Independent Watch App Sample.

Keep in mind that watchOS is not officially supported by Firebase. While we can catch basic unit test issues with GitHub Actions, there may be some changes where the SDK no longer works as expected on watchOS. If you encounter this, please file an issue.

During app setup in the console, you may get to a step that mentions something like "Checking if the app has communicated with our servers". This relies on Analytics and will not work on watchOS. It's safe to ignore the message and continue, the rest of the SDKs will work as expected.

Additional Crashlytics Notes

  • watchOS has limited support. Due to watchOS restrictions, mach exceptions and signal crashes are not recorded. (Crashes in SwiftUI are generated as mach exceptions, so will not be recorded)

Combine

Thanks to contributions from the community, FirebaseCombineSwift contains support for Apple's Combine framework. This module is currently under development and not yet supported for use in production environments. For more details, please refer to the docs.

Roadmap

See Roadmap for more about the Firebase Apple SDK Open Source plans and directions.

Contributing

See Contributing for more information on contributing to the Firebase Apple SDK.

License

The contents of this repository are licensed under the Apache License, version 2.0.

Your use of Firebase is governed by the Terms of Service for Firebase Services.

firebase-ios-sdk's People

Contributors

andrewheard avatar bstpierr avatar charlotteliang avatar cherylenkidu avatar christibbs avatar dconeybe avatar dmandar avatar eldhosembabu avatar elenadoty avatar granluo avatar maksymmalyhin avatar manjanac avatar mikehaney24 avatar mikelehen avatar morganchen12 avatar ncooke3 avatar paulb777 avatar peterfriese avatar protocol86 avatar renkelvin avatar rsgowman avatar ryanwilson avatar samedson avatar schmidt-sebastian avatar var-const avatar visumickey avatar wilhuff avatar wu-hui avatar xiangtiandai avatar zxu123 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

firebase-ios-sdk's Issues

Xcode 9 - Main Thread Sanitizer

[READ] Step 1: Are you in the right place?

Yes

[REQUIRED] Step 2: Describe your environment

  • Xcode version: 9.0 beta (9M136h)
  • Firebase SDK version: 4.0.0
  • Library version: 4.0.0
  • Firebase Product: analytics, core

[REQUIRED] Step 3: Describe the problem

Xcode 9 seems to be reporting a lot of Firebase calls to UIApplication properties. Even though the UI is not being updated this is particularly cumbersome due to the extension of logs it produces on a default environment.

=================================================================
Main Thread Checker: UI API called on a background thread: -[UIApplication delegate]
PID: 740, TID: 51958, Thread name: (none), Queue name: FIRAnalyticsQueue, QoS: 9
Backtrace:
4   UnbabelMobile                       0x0000000101246448 __38+[FIRAnalytics createAppDelegateProxy]_block_invoke + 56
5   libdispatch.dylib                   0x0000000104751614 _dispatch_client_callout + 16
6   libdispatch.dylib                   0x0000000104752368 dispatch_once_f + 120
7   UnbabelMobile                       0x00000001012449d4 __47+[FIRAnalytics startWithConfiguration:options:]_block_invoke_2 + 104
8   libdispatch.dylib                   0x0000000104751654 _dispatch_call_block_and_release + 24
9   libdispatch.dylib                   0x0000000104751614 _dispatch_client_callout + 16
10  libdispatch.dylib                   0x0000000104761008 _dispatch_queue_serial_drain + 716
11  libdispatch.dylib                   0x0000000104754e58 _dispatch_queue_invoke + 340
12  libdispatch.dylib                   0x00000001047621c4 _dispatch_root_queue_drain_deferred_wlh + 412
13  libdispatch.dylib                   0x00000001047697fc _dispatch_workloop_worker_thread + 868
14  libsystem_pthread.dylib             0x00000001aa6e71e8 _pthread_wqthread + 924
15  libsystem_pthread.dylib             0x00000001aa6e6e40 start_wqthread + 4
=================================================================
Main Thread Checker: UI API called on a background thread: -[UIApplication applicationState]
PID: 740, TID: 51959, Thread name: (none), Queue name: com.google.fira.worker, QoS: 9
Backtrace:
4   UnbabelMobile                       0x0000000101244384 FIRAIsAppActive + 56
5   UnbabelMobile                       0x0000000101243830 -[FIRASessionReporter shouldStartNewSession] + 24
6   UnbabelMobile                       0x00000001012433d4 -[FIRASessionReporter initWithPersistedConfig:] + 284
7   UnbabelMobile                       0x000000010122f0bc __48-[FIRAMeasurement startMeasurementOnWorkerQueue]_block_invoke + 1828
8   libdispatch.dylib                   0x0000000104751614 _dispatch_client_callout + 16
9   libdispatch.dylib                   0x0000000104752368 dispatch_once_f + 120
10  UnbabelMobile                       0x000000010122e97c -[FIRAMeasurement startMeasurementOnWorkerQueue] + 268
11  UnbabelMobile                       0x000000010122e748 -[FIRAMeasurement setEnabledOnWorkerQueue:] + 124
12  UnbabelMobile                       0x000000010124304c __52-[FIRAScheduler scheduleOnWorkerQueueBlockID:block:]_block_invoke + 44
13  libdispatch.dylib                   0x0000000104751654 _dispatch_call_block_and_release + 24
14  libdispatch.dylib                   0x0000000104751614 _dispatch_client_callout + 16
15  libdispatch.dylib                   0x0000000104761008 _dispatch_queue_serial_drain + 716
16  libdispatch.dylib                   0x0000000104754e58 _dispatch_queue_invoke + 340
17  libdispatch.dylib                   0x00000001047621c4 _dispatch_root_queue_drain_deferred_wlh + 412
18  libdispatch.dylib                   0x00000001047697fc _dispatch_workloop_worker_thread + 868
19  libsystem_pthread.dylib             0x00000001aa6e71e8 _pthread_wqthread + 924
20  libsystem_pthread.dylib             0x00000001aa6e6e40 start_wqthread + 4

Steps to reproduce:

Compile an app which uses the Analytics platform and configure the FirebaseApp.

Relevant Code:

FirebaseApp.configure()

FirebaseDatabasePersistenceFailure: Corruption: not an sstable (bad magic number)

Environment

  • Xcode version: Xcode 8.3.2
  • Firebase SDK version: 4.0.0
  • Firebase Product: Database 4.0.0

Problem

We've only seen this happen for one user.
iPhone6 v: 10.2.0 (14C92)

They open the app and Firebase immediately throws FirebaseDatabasePersistenceFailure after calling:

FBSDKApplicationDelegate.sharedInstance().application(
            application,
            didFinishLaunchingWithOptions: launchOptions
        )

Fatal Exception: FirebaseDatabasePersistenceFailure
Error initializing persistence: Error Domain=APLevelDBErrorDomain Code=0 "Corruption: not an sstable (bad magic number)" UserInfo={NSLocalizedDescription=Corruption: not an sstable (bad magic number)}

Stack trace

com.apple.main-thread
0  FBSDKCoreKit                   0x100e4395c -[FBSDKURLConnection .cxx_destruct] + 118
1  FBSDKCoreKit                   0x100e3ad40 +[FBSDKServerConfigurationManager loadServerConfigurationWithCompletionBlock:] + 1032
2  FBSDKCoreKit                   0x100e15450 -[FBSDKApplicationDelegate application:didFinishLaunchingWithOptions:] + 168
3  REDACTED                        0x1000b190c specialized AppDelegate.application(UIApplication, didFinishLaunchingWithOptions : [UIApplicationLaunchOptionsKey : Any]?) -> Bool (AppDelegate.swift)
4  REDACTED                        0x1000af004 @objc AppDelegate.application(UIApplication, didFinishLaunchingWithOptions : [UIApplicationLaunchOptionsKey : Any]?) -> Bool (AppDelegate.swift)
5  UIKit                          0x18f1306a4 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 400
6  UIKit                          0x18f340a98 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 3524
7  UIKit                          0x18f346808 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1656
8  UIKit                          0x18f35b104 __84-[UIApplication _handleApplicationActivationWithScene:transitionContext:completion:]_block_invoke.3139 + 48
9  UIKit                          0x18f3437ec -[UIApplication workspaceDidEndTransaction:] + 168
10 FrontBoardServices             0x18addf92c __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 36
11 FrontBoardServices             0x18addf798 -[FBSSerialQueue _performNext] + 176
12 FrontBoardServices             0x18addfb40 -[FBSSerialQueue _performNextFromRunLoopSource] + 56
13 CoreFoundation                 0x1891b6b5c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
14 CoreFoundation                 0x1891b64a4 __CFRunLoopDoSources0 + 524
15 CoreFoundation                 0x1891b40a4 __CFRunLoopRun + 804
16 CoreFoundation                 0x1890e22b8 CFRunLoopRunSpecific + 444
17 UIKit                          0x18f1297b0 -[UIApplication _run] + 608
18 UIKit                          0x18f124534 UIApplicationMain + 208
19 Beeline                        0x10002876c main (main.swift:15)
20 libdispatch.dylib              0x1880c55b8 (Missing)

Firebase storage "unexpected response data" when `put` called while device is offline

  • Xcode version: 8.3.2
  • Firebase Product: storage

To reproduce:
Initiate .put when device has no connectivity, then reenable device connectivity.
E.g. let uploadTask = photoRef.put(compressedData, metadata: metadata) { (metadata, error) in

Issue:
.put closure is not executed.

Output example:

2017-05-26 23:17:56.047225+0800 Xxx[2078:602872] unexpected response data (uploading to the wrong URL?)
{
  "name": "xxx",
  "bucket": "xxx.appspot.com",
  "generation": "1495811875731000",
  "metageneration": "1",
  "contentType": "image/jpeg",
  "timeCreated": "2017-05-26T15:17:55.540Z",
  "updated": "2017-05-26T15:17:55.540Z",
  "storageClass": "STANDARD",
  "size": "358088",
  "md5Hash": "LmNPvUNrVuJoCcJUkr8BiQ==",
  "contentEncoding": "identity",
  "contentDisposition": "inline; filename*=utf-8''xxx",
  "crc32c": "r4VjGA==",
  "etag": "CLjsg7ztjdQCEAE=",
  "downloadTokens": "87fc826a-5b44-4a17-ad06-128a2eb06fa5"
}
2017-05-26 23:17:56.047700+0800 Xxx[2078:602872] Premature failure: upload-status:"final"  location:(null)

Expected result:
.put closure to execute, and no error message in logs.

Note:
Despite the error, the content is still being uploaded after the device resumes connectivity and uploadTask.observe(.progress) { snapshot in continues to fire away. Also uploadTask.observe(.failure) { snapshot in is never executed.

Overview of open source intention; roadmap

It would be very valuable to see the README amended, or perhaps a separate document in the repo added, to cover the intention of this open sourcing effort and where it might (I imagine things are still in flux) be going. If applicable (based on that intention), this document could expand to include a roadmap for the SDK, providing possible areas of community contribution.

Reorganize public headers

[READ] Step 1: Are you in the right place?

yes

[REQUIRED] Step 2: Describe your environment

  • Xcode version: 8.3
  • Firebase SDK version: 4.0
  • Library version: 4.0
  • Firebase Product: all (auth, database, storage, core, messaging, etc)

[REQUIRED] Step 3: Describe the problem

Consolidate public headers for each component into a single Public folder to make source management and podspec maintenance more robust.

Observe Single event method returning cached data

[READ] Step 1: Are you in the right place?

Yes

[REQUIRED] Step 2: Describe your environment

  • Xcode version: 8.3
  • Firebase SDK version: 3.1
  • Library version:
  • Firebase Product: database

[REQUIRED] Step 3: Describe the problem

We are facing the below issue on our iOS app that uses firebase iOS SDk.
To give you some context, the users of our app are part of Groups. Each of these groups have some group information.
In the database we have user who is mapped with a list of group IDs. Using these Group Ids Further we fetch group’s info. Below is the structure.

+User1
    +GroupID1
        +timestamp
    +GroupID2
        +timestamp
+GroupID1
    +groupName:
    +groupCount:……
    +timestamp

Whenever there is a change in group’s info, we have a firebase cloud fuction that updates the timestamp at both the places. Hence any change to group’s info would notify the observers at both references database\GroupID1 and database\User1
The issue we are facing is that we have a continuous observer at reference database\User1 using the method observe event type.
Changes to group info is notifying that continuous observer as expected. After which we are fetching group info using observe single event method. But that group info returned is the cached info.
The info returned at reference database\GroupID1 is always one step old data.
Is there anything we are missing here.

Relevant Code:

observer at reference database\User1 :

observe(_ eventType: .value, with block: @escaping (FIRDataSnapshot) -> Swift.Void, withCancel cancelBlock: ((Error) -> Swift.Void)? = nil) -> UInt

observer at reference database\ GroupID1 :

observeSingleEvent(of eventType: .value, andPreviousSiblingKeyWith block: @escaping (FIRDataSnapshot, String?) -> Swift.Void)

Unable to log in Debug View in Development enviroment

Hi,

I have added firebase analytics in my project. We were able to see logs before but after updating firebase to pod 'Firebase/Core', '~> 4.0.0', I can't see logs in Debug View for my development build. I have enable -FIRDebugEnabled and -FIRAnalyticsDebugEnabled
screen shot 2017-07-18 at 11 14 37 am

I can see logs in my xcode console as:
[Firebase/Analytics][I-XXXxxxxxx] Debug mode is enabled. etc... and
[Firebase/Analytics][I-XXXxxxxxx] Debug logging enabled

But in debug View console, I am unable to see the logs as there is no device available.
screen shot 2017-07-18 at 11 51 09 am

Please help asap as we have very big event coming in few days.

Using Firebase in XCTest when Host application is set to None

  • Xcode version: 8.3.2
  • Firebase SDK version: 4.0
  • Library version: 4.0
  • Firebase Product: core

My unit tests don't use a host application.

But I wanna conduct some unit tests and I need to include Firebase in my test target.

GoogleService-Info.plist is added to both actual target and unit tests.

Because I couldn't mock the Firebase I just wanna call FirebaseApp.configure() in my principal test class.

However, it says it initialized, it throws a stack error;

    import Firebase
    
    class TestSetup: NSObject {
        override init() {
            super.init()
            
            //let url = Bundle(for: type(of: self)).path(forResource: "GoogleService-Info", ofType: "plist")
            //let bundleOption:FirebaseOptions = FirebaseOptions.init(contentsOfFile: url!)!
            
            //let bundleOption:FirebaseOptions = FirebaseOptions.defaultOptions()!
            //bundleOption.bundleID = "com.xxxx.HuginTests"
            //FirebaseApp.configure(options: bundleOption)
            
            FirebaseApp.configure()
            //let _ = FirebaseConfig.sharedInstance
            
        }
    }

It looks like firebase is Successfully initialized but this throws the following error:

    2017-07-19 15:37:42.000 xctest[2990] <Warning> [Firebase/Analytics][I-ACS005000] The AdSupport Framework is not currently linked. Some features will not function properly. Learn more at 
    2017-07-19 15:37:42.023 xctest[2990] <Notice> [Firebase/Crash][I-CRA000004] Successfully initialized
    2017-07-19 15:38:00.141 xctest[2990:122374] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[0]'
    *** First throw call stack:
    (
    	0   CoreFoundation                      0x00000001049a5b0b __exceptionPreprocess + 171
    	1   libobjc.A.dylib                     0x000000010440a141 objc_exception_throw + 48
    	2   CoreFoundation                      0x00000001048ba56d -[__NSPlaceholderArray initWithObjects:count:] + 269
    	3   CoreFoundation                      0x00000001048c12b4 +[NSArray arrayWithObjects:count:] + 52
    	4   HuginTests                          0x0000000113bccdbf -[RCNConfigDBManager loadMainTableWithBundleIdentifier:fromSource:] + 163
    	5   HuginTests                          0x0000000113bccc8e __62-[RCNConfigDBManager loadMainWithBundleIdentifier:fromSource:]_block_invoke + 34
    	6   libdispatch.dylib                   0x0000000105f33792 _dispatch_client_callout + 8
    	7   libdispatch.dylib                   0x0000000105f183de _dispatch_barrier_sync_f_invoke + 126
    	8   libdispatch.dylib                   0x0000000105f1c304 _dispatch_barrier_sync_f_slow + 529
    	9   HuginTests                          0x0000000113bccbc9 -[RCNConfigDBManager loadMainWithBundleIdentifier:fromSource:] + 249
    	10  HuginTests                          0x0000000113bc9506 -[RCNConfigContent loadConfigFromMainTable] + 70
    	11  HuginTests                          0x0000000113bc7a78 -[RCNConfigContent initWithDBManager:] + 380
    	12  HuginTests                          0x0000000113bc459e -[FIRRemoteConfig initWithDBManager:] + 156
    	13  HuginTests                          0x0000000113bc44da __31+[FIRRemoteConfig remoteConfig]_block_invoke + 86
    	14  libdispatch.dylib                   0x0000000105f33792 _dispatch_client_callout + 8
    	15  libdispatch.dylib                   0x0000000105f1ea8d dispatch_once_f + 69
    	16  HuginTests                          0x0000000113bc4481 +[FIRRemoteConfig remoteConfig] + 45
    	17  HuginTests                          0x0000000113bc3ce3 +[FIRRemoteConfig(FIRApp) receivedReadyToConfigureNotification:] + 194
    	18  CoreFoundation                      0x0000000104944c2c __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12
    	19  CoreFoundation                      0x0000000104944b29 _CFXRegistrationPost + 425
    	20  CoreFoundation                      0x0000000104944892 ___CFXNotificationPost_block_invoke + 50
    	21  CoreFoundation                      0x0000000104908102 -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1826
    	22  CoreFoundation                      0x0000000104907261 _CFXNotificationPost + 673
    	23  Foundation                          0x0000000103da7ca4 -[NSNotificationCenter postNotificationName:object:userInfo:] + 66
    	24  HuginTests                          0x0000000113b71b6e +[FIRApp sendNotificationsToSDKs:] + 381
    	25  HuginTests                          0x0000000113b70b47 +[FIRApp configureDefaultAppWithOptions:sendingNotifications:] + 302
    	26  HuginTests                          0x0000000113b707f7 +[FIRApp configure] + 381
    	27  HuginTests                          0x0000000113a76118 _TFC10HuginTests9TestSetupcfT_S0_ + 136
    	28  HuginTests                          0x0000000113a76201 _TToFC10HuginTests9TestSetupcfT_S0_ + 17
    	29  XCTest                              0x000000010433383b _XCTestMain + 508
    	30  xctest                              0x0000000103d18679 xctest + 9849
    	31  libdyld.dylib                       0x0000000105f7c65d start + 1
    	32  ???                                 0x0000000000000005 0x0 + 5
    )
    libc++abi.dylib: terminating with uncaught exception of type NSException

How can I fix this?

[auth] anonymous auth missing 'firebase' providerData

[READ] Step 1: Are you in the right place?

  • For issues or feature requests related to the code in this repository
    file a Github issue.
    • If this is a feature request make sure the issue title starts with "FR:".
  • For general technical questions, post a question on StackOverflow
    with the firebase tag.
  • For general Firebase discussion, use the firebase-talk
    google group.
  • For help troubleshooting your application that does not fall under one
    of the above categories, reach out to the personalized
    Firebase support channel.

[REQUIRED] Step 2: Describe your environment

  • Xcode version: Any
  • Firebase SDK version: 4.0.2
  • Library version: Any
  • Firebase Product: auth (auth, database, storage, core, messaging, etc)

[REQUIRED] Step 3: Describe the problem

FIRUser.providerData array is empty when signed in anonymously, however the android sdk returns 1 array item when signed in anonymously with the following properties in the map/dictionary:

image

Steps to reproduce:

Sign in anonymously. See code below.

Relevant Code:

FIRApp *firApp = [FIRApp appNamed:@"foobar"];

[[FIRAuth authWithApp:firApp] signInAnonymouslyWithCompletion:^(FIRUser *user, NSError *error) {
  // user.providerData array is empty
}];

Have found this issue whilst working on the react native firebase implementation, library specific code is as follows:

runTransactionBlock works wrong in offline mode

[READ] Step 1: Are you in the right place?

Not sure

[REQUIRED] Step 2: Describe your environment

Xcode version: 8.3.2
Firebase SDK version: 4.0.0
Library version: 4.0.0
Firebase Product: database

[REQUIRED] Step 3: Describe the problem

Steps to reproduce:

initial count value in database is 0
application started and wifi connection is switched off
application performs two calls to runTransactionBlock which increases counter by 1. database value is still 0 as expected
it works fine locally
now wifi connection is switched on
runTransaction successfully committed two values, but database value equals to 1

EXPECTED: database value should be equal to 2
please note that if runTransactionBlock called in offline 7 times than server value is 6 instead of 7.

Relevant Code:

        self.ref.child("values/contributed").runTransactionBlock({ (data) -> TransactionResult in
            if let value = data.value as? Int {
                debugPrint("FB BEFORE \(data)")
                data.value = value + 1
                debugPrint("FB AFTER \(data)")
                return .success(withValue: data)
            } else {
                data.value = 1
                debugPrint("FB EMPTY \(data)")
                return .success(withValue: data)
            }
        }) { (error, commited, snapshot) in
            if let error = error {
                debugPrint("FB ERROR: \(error)")
            } else {
                debugPrint("FB COMMITTED \(snapshot)")
            }
        }

offline output:
"FB BEFORE FIRMutableData (top-most transaction) (null) 0"
"FB AFTER FIRMutableData (top-most transaction) (null) 1"
"FB BEFORE FIRMutableData (top-most transaction) (null) 1"
"FB AFTER FIRMutableData (top-most transaction) (null) 2"

online output:
"FB BEFORE FIRMutableData (top-most transaction) (null) 0"
"FB AFTER FIRMutableData (top-most transaction) (null) 1"
"FB COMMITTED Optional(Snap (contributed) 1)"
"FB COMMITTED Optional(Snap (contributed) 1)"

FR: Allow background uploads and downloads

  • Firebase SDK version: 4.04
  • Firebase Product: storage

When an UploadTask/DownloadTask is created when the app is in background, it does leverage NSURLSession's background transfer and "discretionary" is set to true by default by the OS:

https://developer.apple.com/documentation/foundation/nsurlsessionconfiguration/1411552-discretionary

The result is that the task will be performed at the OS's discretion, like only if the device is WiFi connected.

However, the current API is limited in two aspect:

  1. Sometimes an app would like the task to proceed in background no matter what (with "discretionary" set to false). There's no way in Firebase API to specify this.

  2. Usually an app would create the UploadTask/DownloadTask when it is running in foreground, but expect the task to continue running in background and at the OS's discretion (i.e. NSURLSession created with [NSURLSessionConfiguration backgroundSessionConfigurationWithIdentifier] and with "discretionary" set to true). This is useful for performing large files transfer without requiring the user to keep the app opened and simultaneously give discretion to the OS to help avoid consuming precious cellular bandwidth.

Hence, it'll be best if Firebase iOS can provide explicit API for an app to specify if OS discretion is allowed in an UploadTask/DownloadTask, and that the task can be run in background (even if the task is created when the app is in foreground).

FR: Adding tvOS Support

I'm making use of a old version of the Firebase SDK which tweaked the v2 SDK to allow it to be used in tvOS applications.

This is working well right now but missing out on some additional features that have been added since, also worried using such an old SDK may stop working in the production app in the future.

I'm aware there would be significant changes needed due to the limitations on persistent storage and happy to have data load on launch as it is doing in the current solution. Would love to kick off a discussion around this.

Phone auth not working

Sms with a code does not arrive. Everything looks normal, no errors in debug mode. I get the verificationId, but not the SMS. Two days ago everything worked fine, with the same code.

es6 import fails with module-aware browsers

[READ] Step 1: Are you in the right place?

Yes. This is an import problem with the sdk.

[REQUIRED] Step 2: Describe your environment

  • Xcode version: _____
  • Firebase SDK version: [email protected]
  • Library version: _____
  • Firebase Product: _____ (auth, database, storage, core, messaging, etc)

[REQUIRED] Step 3: Describe the problem

https://www.npmjs.com/package/firebase says:

If you are using ES6 imports or TypeScript:

import * as firebase from 'firebase';
var app = firebase.initializeApp({ ... });

This fails for me. I note a few oddities in the first line:

  • The path is not legal module path: needs to be complete http://paths/to/firebase.js or a relative path like ./firebase.js. Note the .js and the pathyness.
  • The trailing ";" is illegal.

Attempting loading the module in a module-aware browser fails to load with the error described below.

Steps to reproduce:

In my repo: npm install firebase and copy ./node_modules/firebase/firebase.js to a test dir/
Create a test html file in the same dir:

<html>
<head>
  <title>test</title>
</head>
<body>
  <script type="module">
  import * as firebase from './firebase.js'
  </script>
</body>
</html>

Run this in a module-ready browser. I used Canary and Safari. Both get the same error:
TypeError: undefined is not an object (evaluating 'k.navigator')

Safari shows this (un-minified)
snap 07 19 17-11 17 07

Relevant Code:

See above. Also this Stack Overflow:

https://stackoverflow.com/questions/31221357/webpack-firebase-disable-parsing-of-firebase

Phone Auth user not behaving as expected

[READ] Step 1: Are you in the right place?

I really hope so, and am very sorry if not.

[REQUIRED] Step 2: Describe your environment

  • Xcode version: 8.3.2
  • Firebase SDK version: 4.0.0
  • Library version: 4.0.0?
  • Firebase Product: auth (specifically, phone auth)

[REQUIRED] Step 3: Describe the problem

Steps to reproduce:

I have implemented phone auth, using the sample code provided in the docs. When I call Auth.auth().signIn(with: credential) { user, error in ...., the user seems to be valid, with a non-nil phoneNumber (I'm using phone auth). Later, when I call Auth.auth().currentUser, the user I get back also has a non-nil phoneNumber. However, when I kill my app, and restart it, if I call Auth.auth().currentUser, the user I get back has the .phoneNumber property set to nil.

I'm really sorry to bother you, and hope I haven't broken any rules.

Unable to create "archive" - Unable to insert branch island. No insertion point available. for architecture armv7

I am unable to create an archive while I include the pod

pod 'Firebase/core'

I get the following error
ld: Unable to insert branch island. No insertion point available. for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

The version installed is

Installing Firebase 4.0.4
Installing FirebaseAnalytics 4.0.2
Installing FirebaseCore 4.0.4
Installing FirebaseInstanceID 2.0.0

Any idea what I can do to fix this?

crash in +[FRepoManager createRepo:config:database:] stemming from initializing Database.database()

Environment

  • Xcode version: 8.3.2
  • Firebase SDK version: 4.0.0
  • Library version: unsure what Library is
  • Firebase Product: database

[REQUIRED] Step 3: Describe the problem

Steps to reproduce:

Crash in +[FRepoManager createRepo:config:database:]. Here's the relevant part of the stack trace:

0   CoreFoundation                      0x000000010b386b0b __exceptionPreprocess + 171
1   libobjc.A.dylib                     0x0000000109f55141 objc_exception_throw + 48
2   CoreFoundation                      0x000000010b2a16e2 -[__NSDictionaryM setObject:forKey:] + 1042
3   wrytr                               0x00000001088d7f83 +[FRepoManager createRepo:config:database:] + 404
4   wrytr                               0x00000001088bed22 -[FIRDatabase ensureRepo] + 151
5   wrytr                               0x00000001088be3eb -[FIRDatabase reference] + 31
6   wrytr                               0x0000000108854471 _TFCC5wrytr8Firebase8ProvidercfT_S1_ + 97

It seems to be related to firebase/quickstart-ios#261, but the fix provided there (be on the main thread) doesn't apply to me, as my code is executing on Thread 1:
screen shot 2017-05-25 at 11 29 56 am

I know the crash is happening somewhere inside a dictionary set in this method in FRepoManager, but I'm not sure why

Relevant Code:

https://github.com/AndrewSB/wrytr/blob/master/Common/API/FirebaseProvider.swift#L13

Linker command failed with exit code 1 (use -v to see invocation) for FIrebase 4.0.0

Please, read this question.

https://stackoverflow.com/questions/43809514/clang-error-linker-command-failed-with-exit-code-1firebase

In my case the environment is

Xcode version: 8.3
Firebase SDK version: 4.0
Library version: 4.0
Firebase Product: analytics, admob

In my case, Firebase 4.0.0 fails for both manual and cocoapods variants of integration.
without '-ObjC' ('-force_load') it fails with fira_UTF32Length unrecognized selector sent to instance
with '-ObjC' it fails with clang: error: linker command failed with exit code 1 (use -v to see invocation)

What is it? Is it possible to make it work?

Project with Firebase and gRPC-Core third library

[READ] Step 1: Are you in the right place?

YES

[REQUIRED] Step 2: Describe your environment

  • Xcode version: 8.3.2
  • Firebase SDK version: 4.0.0
  • Library version: 4.0.0
  • Firebase Product: core, analytics, message, auth, database, remote config

[REQUIRED] Step 3: Describe the problem

Starting with firebase 3.13.X, application give a BAD_ACCESS on gRPC-Core/pb_decode.c on line 796, just later [FIRApp configure] on App Delegate. Using firebase 3.12 work fine. That's a Protobuffer issue?

Steps to reproduce:

Just put firebase version 3.13.0 or greater with pod 'gRPC-ProtoRPC' latest version on same project and the issue occurs

Relevant Code:

No such module "Firebase" in Swift Tests (Add explicit Firebase modulemap)

[READ] Step 1: Are you in the right place?

Yes

[REQUIRED] Step 2: Describe your environment

  • Xcode version: Any
  • Firebase SDK version: 4.0.0
  • Library version: 4.0.0
  • Firebase Product: All (auth, database, storage, core, messaging, etc)

[REQUIRED] Step 3: Describe the problem

Swift unit tests fail to find Firebase module. During the distribution process, the Firebase podspec relies on Core to set up proper header search paths using user_target_xcconfig. Firebase should have its own modulemap instead of relying on the header search paths from Core.

Steps to reproduce:

  1. Create a Swift project with unit tests
  2. pod init to create a Podfile
  3. Add pod 'Firebase' to Podfile under use_frameworks!
  4. Run pod update
  5. Open the generated xcworkspace
  6. Add import Firebase to the AppDelegate.swift
  7. Add @testable import <YourProjectName> into <YourProjectName>Tests.swift
  8. A "No such module 'Firebase'" error will appear.

Relevant Code:

Currently generated podspec

Relevant Issues:

Swift unit tests fail to find Firebase module
Swift Cocoapod can't import Firebase pod dependencies
Unable to run tests (quickstarts)

Workarounds:

  • Add "${PODS_ROOT}/Firebase/Core/Sources" to your Tests target only under Build Settings -> Header Search Paths

FR: Source maps for docs

Add a source map to the doc generation process so that reference docs can link directly into source files for each function/constant/etc.

FR: macOS support

The biggest disappointment with the 3.x release was loss of macOS support. Let's fix that!

Extreme Double Database Unit Tests fail in Xcode 9 simulator runs

The testExtremeDoublesAsTrackedQuery and testExtremeDoublesAsUserWrites tests of FLevelDBStorageEngineTests.m fail when doing a simulator unit test run in Xcode 9.

/Users/paulbeusterien/gh/firebase-ios-sdk/Example/Database/Tests/Unit/FLevelDBStorageEngineTests.m:453: error: -[FLevelDBStorageEngineTests testExtremeDoublesAsTrackedQuery] : (([engine loadTrackedQueries]) equal to (@[doesWork])) failed: ("(
    "<FTrackedQuery: 0x61800004ae60>",
    "<FTrackedQuery: 0x61800004aec0>"
)") is not equal to ("(
    "<FTrackedQuery: 0x60000004bee0>"
)")
/Users/paulbeusterien/gh/firebase-ios-sdk/Example/Database/Tests/Unit/FLevelDBStorageEngineTests.m:468: error: -[FLevelDBStorageEngineTests testExtremeDoublesAsUserWrites] : (([engine userWrites]) equal to (@[[[FWriteRecord alloc] initWithPath:PATH(@"other") overwrite:NODE(@"should-work") writeId:3 visible:YES]])) failed: ("(
    "FWriteRecord { writeId = 1, path = /foo, overwrite = 2.225073858507201e-308, visible = 1 }",
    "FWriteRecord { writeId = 2, path = /foo, merge = {\n    bar = \"2.225073858507201e-308\";\n} }",
    "FWriteRecord { writeId = 3, path = /other, overwrite = should-work, visible = 1 }"
)") is not equal to ("(
    "FWriteRecord { writeId = 3, path = /other, overwrite = should-work, visible = 1 }"
)")

Main thread sanitizer runtime error in Messaging

[READ] Step 1: Are you in the right place?

Yes

[REQUIRED] Step 2: Describe your environment

  • Xcode version: Xcode 9 beta 2
  • Firebase SDK version: 4.0.3
  • Library version: 2.0.0 (Messaging library?)
  • Firebase Product: Messaging (auth, database, storage, core, messaging, etc)

[REQUIRED] Step 3: Describe the problem

Steps to reproduce:

See relevant code example in next section

Log output from Xcode:

2017-07-07 11:39:12.148061-0600 AppName[17516:980609] [reports] Main Thread Checker: UI API called on a background thread: -[UIApplication applicationState]
PID: 17516, TID: 980609, Thread name: (none), Queue name: com.apple.usernotifications.UNUserNotificationServiceConnection.call-out, QoS: 0
Backtrace:
4   AppName                     0x00000001097ec8fe -[FIRMessaging shouldBeConnectedAutomatically] + 83
5   AppName                     0x00000001097ec973 -[FIRMessaging updateAutomaticClientConnection] + 37
6   AppName                     0x00000001096b3d70 _T011AppName15RemoteMessagingC12connectToFcm33_6C36BB651A0078C861353A7147499465LLyyF + 1168
7   AppName                     0x00000001096b4e24 _T011AppName15RemoteMessagingC8register7RxSwift10ObservableCyytGSo13UIApplicationC3for_tFAE10Disposable_pAE11AnyObserverVyytGcfU_ySb_s5Error_pSgtcfU0_ + 1252
8   AppName                     0x00000001096b9df2 _T011AppName15RemoteMessagingC8register7RxSwift10ObservableCyytGSo13UIApplicationC3for_tFAE10Disposable_pAE11AnyObserverVyytGcfU_ySb_s5Error_pSgtcfU0_TA + 130
9   AppName                     0x00000001096b4fa3 _T0Sbs5Error_pSgIxyx_SbSo7NSErrorCSgIyByy_TR + 115
10  libdispatch.dylib           0x000000011021666d _dispatch_call_block_and_release + 12
11  libdispatch.dylib           0x0000000110217658 _dispatch_client_callout + 8
12  libdispatch.dylib           0x000000011022008c _dispatch_queue_serial_drain + 1173
13  libdispatch.dylib           0x0000000110220aa5 _dispatch_queue_invoke + 342
14  libdispatch.dylib           0x000000011021c3a6 _dispatch_queue_override_invoke + 743
15  libdispatch.dylib           0x0000000110223d3b _dispatch_root_queue_drain + 785
16  libdispatch.dylib           0x00000001102239c7 _dispatch_worker_thread4 + 54
17  libsystem_pthread.dylib     0x00000001106833b5 _pthread_wqthread + 1370
18  libsystem_pthread.dylib     0x0000000110682e49 start_wqthread + 13

Relevant Code:

Messaging.messaging().shouldEstablishDirectChannel = true

Solve flaky Travis Issues

We're seeing three variations of flakiness in Travis:

  • "The command "./test.sh" exited with 65."

    • This is the easiest one to workaround since the bottom of the log shows success and usually the second travis run kicked off by a PR succeeds.
  • "No output has been received in the last 10m0s, this potentially indicates a stalled build or something wrong with the build itself.
    Check the details on how to adjust your build configuration on: https://docs.travis-ci.com/user/common-build-problems/#Build-times-out-because-no-output-was-received"

    • This can occur anywhere in a Travis run and stops it before completion
  • Duplicate OCMock framework errors

    • It's the rarest failure I've seen more than once - perhaps related to faulty parallelism between Xcode builds?

Swift unit tests fail to find Firebase module

[REQUIRED] Step 2: Describe your environment

  • Xcode version: 8.3
  • Firebase SDK version: 4.0
  • Library version: 4.0
  • Firebase Product: all (auth, database, storage, core, messaging, etc)

[REQUIRED] Step 3: Describe the problem

Steps to reproduce:

Unit tests for Swift projects that import Firebase fail to build
Details in http://stackoverflow.com/questions/38216090/xcode-unit-testing-with-cocoapods/39602648
Reproducible test case at https://github.com/marcelofabri/BrokenFirebase

observe single event returning cached data

We are facing the below issue on our iOS app that uses firebase iOS SDk.
To give you some context, the users of our app are part of Groups. Each of these groups have some group information.
In the database we have user who is mapped with a list of group IDs. Using these Group Ids Further we fetch group’s info. Below is the structure.

+User1
    +GroupID1
        +timestamp
    +GroupID2
        +timestamp
+GroupID1
    +groupName:
    +groupInfo:
    +groupCount:……
    +timestamp

Whenever there is a change in group’s info, we have a firebase cloud fuction that updates the timestamp at both the places. Hence any change to group’s info would notify the observers at both references database\GroupID1 and database\User1
The issue we are facing is that we have a continuous observer at reference database\User1 using the method observe event type.
Changes to group info is notifying that continuous observer as expected. After which we are fetching group info using observe single event method. But that group info returned is the cached info.
The info returned at reference database\GroupID1 is always one step old data.
Is there anything we are missing here.

[!] Error installing nanopb - 503 Service Unavailable

Xcode version: 8.3.3
Firebase SDK version: 4.0.4
Firebase Product: FirebaseCore (4.0.4)

The problem

Firebase core has the nanopb as dependency. When i run pod install command can not clone the repository because it is offline.

I try with the most actually version of cocoapods (beta3) and 1.2.1 version.

[!] Error installing nanopb
[!] /usr/bin/curl -f -L -o /var/folders/31/4qx125qs6wg0k8m8n6fyjsx80000gq/T/d20170727-2933-4u9uhv/file.tgz http://koti.kapsi.fi/~jpa/nanopb/download/nanopb-0.3.8.tar.gz --create-dirs --netrc-optional

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   330  100   330    0     0    522      0 --:--:-- --:--:-- --:--:--   522
  0     0    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0
curl: (22) The requested URL returned error: 503 Service Unavailable

Steps to reproduce:

run pod repo update
run pod install

didReceiveRemoteNotification is not called with FCM Implementation

[READ] Step 1: Are you in the right place?

I think so

[REQUIRED] Step 2: Describe your environment

  • Xcode version: Xcode Version 9.0 beta 3
  • Firebase SDK version: 4.0.4
  • Library version: _____
  • Firebase Product: messaging/auth (auth, database, storage, core, messaging, etc)

[REQUIRED] Step 3: Describe the problem

According to the documentation, When setting up the Firebase Phone Authentication, it is necessary to implement didReceiveRemoteNotification delegate so that we can detect the push notification that was received for validation of phone auth process, However, with the new UNUserNotificationCenter, didReceiveRemoteNotification is only called when the app is in the background and user interacts with the notification directly. So in case of phone auth this method is never called.

The problem is didReceiveRemoteNotification is not called with the FCM Notification implementation and the documentation does not suggest any alternatives

Steps to reproduce:

Run the example Messaging app

Relevant Code:

Code can found in the example app

[Firebase/Auth][I-AUT000015] The UIApplicationDelegate must handle remote notifcation for phone number authentication to work.

[READ] Step 1: Are you in the right place?

Hope so.

[REQUIRED] Step 2: Describe your environment

  • Xcode version: 8.3.2
  • Firebase SDK version: 4.0.0
  • Firebase Product: Auth

[REQUIRED] Step 3: Describe the problem

Trying to get Phone Auth working. Was previously using Digits without issues.

Getting the following completely bonkers error logged in the console:
[Firebase/Auth][I-AUT000015] The UIApplicationDelegate must handle remote notifcation for phone number authentication to work.

along with an alert saying Your request couldn't be completed. Try again later.

The auth delegate method is NOT being called with this error it's just being logged and phone can't be verified after that.

Furthermore, I can confirm that I AM registered successfully with APNS (got device token), set the APNS token in [FIRMessaging messaging], and got the FCM token successfully before attempting Phone Auth...

  1. What does this error even mean?
  2. Why am I getting this error when I've clearly set everything up to receive notifications already...

Steps to reproduce:

  • Turn off swizzling
  • FIRApp configureWithOptions
  • Register for APNS and confirm you get token
  • Wait for FCM token through the refresh delegate method
  • Initiate Firebase Auth UI flow using just the Phone auth provider.
  • Enter your phone number and tap verify
  • Get this error logged and the above alert error shown

FirebaseApp.configure() conflicts with other frameworks (Facebook Login)

[READ] Step 1: Are you in the right place?

Yes

[REQUIRED] Step 2: Describe your environment

  • Xcode version: 8.3 (8E162)
  • Firebase SDK version: 4.0.0
  • Library version: 4.0.1
  • Firebase Product: Core

[REQUIRED] Step 3: Describe the problem

After running FirebaseApp.configure(), other frameworks that rely on url schemes will stop working.

Steps to reproduce:

  • Have a project that uses Facebook for authentication and Firebase for Analytics, for example.
  • Initialize both of them
  • Try to login with Facebook - a blank screen will show up and the login process will never end.

Alternatively

  • Comment FirebaseApp.configure()
  • See that Facebook and other frameworks will start working again.

Same problem was reported by someone on stackoverflow. Unfortunately it looks like whatever the configuration method is doing with the original openURL implementation is killing other guys that do the same.

FR: Carthage support

Now that the Firebase SDKs are open source, can we then have Carthage support? 😍

*** Cloning firebase-ios-sdk
*** Checking out firebase-ios-sdk at "4.0.0"
*** Skipped building firebase-ios-sdk due to the error:
Dependency "firebase-ios-sdk" has no shared framework schemes

Custom URLProtocol doesn't work with firebase calls

  • Xcode version: 8.3.3 and 9.0 beta 3
  • Firebase SDK version: 4.0.0
  • Firebase Product: auth, database

I use a custom URLProtocol class in my tests. If I register my URLProtocol class and use URLSession to load a URL, the custom class is used, but if I make a call to any firebase API, the custom class doesn't get used.

Steps to reproduce:

  1. Write a URLProtocol subclass, implement canInit(with request:), set a breakpoint here
  2. In the setUp() method of your test class, add URLProtocol.registerClass(CustomURLProtocol.self)
  3. Write a test and load any URL using URLSession.shared.dataTask(with:)
  4. Run the test and notice the breakpoint in canInit gets hit
  5. Change the test to call Auth.auth().createUser or Database.database().reference().child(path).setValue
  6. Run the test and notice the breakpoint in canInit does not get hit

Test issue for the bot, please leave this open for a day or two while I work on it

[READ] Step 1: Are you in the right place?

Yes I am

[REQUIRED] Step 2: Describe your environment

  • Xcode version: _____
  • Firebase SDK version: _____
  • Library version: _____
  • Firebase Product: _____ (auth, database, storage, core, messaging, etc)

[REQUIRED] Step 3: Describe the problem

Steps to reproduce:

What happened? How can we make the problem occur?
This could be a description, log/console output, etc.

Relevant Code:

// TODO(you): some code

Database returning wrong values

  • Xcode version: 8.3.2
  • Firebase SDK version: Using cocoapod

An issue started occurring last night with a production app. It seems the firebase database values that are being returned are incorrect. What should be an array is being returned as a Dictionary.

Here is a screenshot of the database
screen shot 2017-06-02 at 4 57 20 am

Here is a screen shot of the console printout of the returned value
screen shot 2017-06-02 at 4 59 08 am

The highlighted area in the picture above shows that what should be returned as elements in an array are being returned as keys in a dictionary.

Heres a screenshot of the exported json file
screen shot 2017-06-02 at 5 01 35 am

Why is this being returned incorrectly all of a sudden??
Again the apps been in production for the past month with no issues, and this problem started occurring last night with no changes made in my code or on the database.

Heres a screenshot of the code
screen shot 2017-06-02 at 5 03 02 am

Use FIRNetwork instead of GTMSessionFetcher in FirebaseAuth

The arm64 archive size of GTMSession Fetcher is 1.1M.

Logging may need to be added to FIRNetwork, but that's only 2K in GTMSessionFetcher.

Size details (from the zip distribution):

$ lipo -thin arm64 -output a.a GTMSessionFetcher
 $ ls -l a.a
-rw-r--r--  1 paulbeusterien  eng  1138448 Jun  7 16:58 a.a
$ ar tv a.a
rw-r--r--   65279/5000      12344 Jun  7 16:56 2017 __.SYMDEF
r-xr-xr-x   65279/0         36800 Dec 31 16:00 1969 GTMGatherInputStream_843c0ae8f1a0d1a15ab489edc2e8f6e7.o
r-xr-xr-x   65279/0         83536 Dec 31 16:00 1969 GTMMIMEDocument_7369c6cdb3c3f08bcf62605077a5df9f.o
r-xr-xr-x   65279/0         46896 Dec 31 16:00 1969 GTMReadMonitorInputStream_0e816e5afcd2e3772f35e9955359f7fb.o
r-xr-xr-x   65279/0        533464 Dec 31 16:00 1969 GTMSessionFetcher_e584bb187828955e4ae49784bfb00cdc.o
r-xr-xr-x   65279/0          1984 Dec 31 16:00 1969 GTMSessionFetcherLogging_797cecf8edd5f3a29454dffe16f55291.o
r-xr-xr-x   65279/0        207576 Dec 31 16:00 1969 GTMSessionFetcherService_5a193cd6f0030259e916bfe85685423c.o
r-xr-xr-x   65279/0        214888 Dec 31 16:00 1969 GTMSessionUploadFetcher_d08b9eb98b259f6449b7f5ba7f534b75.o

Verify Xcode 9 - GitHub integration

[REQUIRED] Step 2: Describe your environment

  • Xcode version: 9
  • Firebase SDK version: 4.x
  • Library version: 4.x
  • Firebase Product: core

[REQUIRED] Step 3: Describe the problem

At WWDC, Apple announced increased integration between GitHub and Xcode. Details and demos at https://developer.apple.com/videos/play/wwdc2017/405/. We need to verify that the new workflow works well with the firebase-ios-sdk repo, cloning, opening in Xcode, etc.

Unconsistent behaviour when converting data types into Swift objects

  • Xcode version: 8.3.2
  • Firebase SDK version: 4.0.0
  • Firebase Product: database

The problem

The way some data stored in Firebase Database is converted into Swift objects is unconsistent.

Steps to reproduce:

For example, i have data stored in Firebase Database like this (JSON)

"test-dict": {
  "2": true,
  "3": true,
  "4": true
},

when i am trying to cast this in Swift to Dictionary [String: Any] or [String: Bool] it always fails.
the actual type in swift for this will be Array [Any]
particular for this example the array will be: [NSNull, NSNull, Bool, Bool, Bool]

but when we add another literal key to the dict:

"test-dict": {
  "2": true,
  "3": true,
  "4": true,
  "a": true
},

it successfully casts to [String: Any] or [String: Bool]

Was this behaviour supposed to be so or is it an issue?

Persisted queries should return ints instead of round doubles after int overwrites

This was originally flutter/flutter#10825 but it looks like a Firebase bug.

Environment

  • Xcode version: 8.3.3
  • Firebase SDK version: 4.0.2
  • Library version: 4.0.0
  • Firebase Product: database

Problem

Reduced test case:

#import "AppDelegate.h"
@import Firebase;
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  [FIRApp configure];
  [[FIRDatabase database] setPersistenceEnabled:YES];
  FIRDatabaseReference *ref = [[FIRDatabase database].reference child:@"counter"];
  [ref keepSynced:YES];
  [ref observeSingleEventOfType:FIRDataEventTypeValue withBlock:^(FIRDataSnapshot * _Nonnull snapshot) {
    NSLog(@"Type of %@ is %d", snapshot.value, (int)CFNumberGetType((CFNumberRef)snapshot.value));
  }];
  [ref setValue:[NSNumber numberWithInt:42]];
  return YES;
}
@end

The first time this code runs, the snapshot value is an integer NSNumber. The second time, it's an NSDecimalNumber with a CFNumberType of kCFNumberDoubleType. Presumably this is because the persistent store is serializing numbers differently from the cloud Firebase. But Firebase queries should never yield doubles for round numbers like 42.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.