iOS - Duplicate symbols when added Firebase Messaging (conflict with Google Analytics) - ios

I want to add Firebase Cloud Messaging to my project which has already other services from Google (like Analytics). I am using cocoapods and I added to my podfile:
pod 'Firebase'
pod 'Firebase/Messaging'
I run pod install and everything looked good but when I am trying to build project I get many duplicate symbol errors:
duplicate symbol _OBJC_CLASS_$_ACPGmpAudienceRoot in:
.../Pods/Google/Libraries/libGGLCore.a(GmpAudience.pb.o)
.../Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/FirebaseAnalytics(GmpAudience.pb_d68254ec585824fa42de6de2f056cda0.o)
... more and more duplicate symbol errors ...
How can I fix it? Why with Messaging there is added Analytics library too? I don't need it. I tried Clean project and delete Derived data but for now without luck.

Update your Google/(Google analytics) pod version to 3.0 higher .
I was using version 2.0.4, I did pod update and the following pods were update:
Installing Google 3.0.3 (was 2.0.4)
Installing GoogleSignIn 4.0.0 (was 3.0.0)
After that I was able to use Google analytics with Firebase

Depending on your use case, one thing you can consider: If you use Google Tag Manager, you can integrate with Firebase Analytics, and use GTM to forward the event data to Google Analytics if you prefer to have app and web data together or want to use Google Analytics for some other reason.

I have exactly the same issue - an iOS app that is already using Google Analytics, but I want to add Firebase Messaging, just so the app can have a push notification capability. I added "pod 'Firebase/Messaging'" to the Podfile, and had the same linking errors on compiling.
A lot of searching revealed this compiler setting: Your Target -> Build Settings - Apple LLVM 7.1 - Code Generation -> No Common Blocks - set it to 'Yes', like this:
On Xcode 7.3 it seems the default for that setting is 'No', bu on making that change all the linking errors went away and the app built without issues.

Related

'PromisesObjC/FBLPromise+All.h' file not found when using react-native-peripheral - is there any way I can fix this?

When trying to build my react-native ios app, I am getting this error as in the picture:
enter image description here
The library for which the error is occurring is called react-native-peripheral, which I understand has not been updated in 3 years. I have tried pod install already, and I have found that the app will build without this error when I use the module in a new project with no other external libraries installed.
I am very new to react-native and app development; however if it is of any help I have a suspicion that this issue may be due to inconsistent Pod version requirements of the PromisesObjC pod.
I am using react-native-firebase for firebase (google cloud) storage, and I notice that this requires PromisesObjC (<3.0, >= 1.2), as below:
enter image description here
If you could offer any guidance that would be great. I know that it is probably not advised to still use react-native-peripheral given that it is no longer maintained, but I can't find any other library which allows me treat my iphone like a bluetooth peripheral (while the screen is turned off).
I am using cocoapods.
Thanks.

Can I integrate one or more SDK inside my own iOS SDK?

I have built an SDK in which I need to take control and make a decision using Firebase remote configurations also I need to push some data from SDK to Firestore directly.
Can anyone please help me with the procedure for integration.
Or correct me if I am going wrong.
If you are using CocoaPods as the package manager for your SDK, you can define dependencies in the Podspec file. Firebase is available as a CocoaPods pod so you can directly integrate it as a dependency. More information on how to define dependencies can be found in the Podspec Syntax Reference.

Firebase error even if I don't use it

In my objective-c application, I added Google Analytics using Pods (this is how I add it: pod 'Google/Analytics'). In the Pods folder, I found those Firebase packages FirebaseAnalytics, FirebaseCore and the FirebaseInstanceId). When I run my application, sometimes it crash and this is what I'm getting in the console:
[Firebase/Core][I-COR000003] The default Firebase app has not
yet been configured. Add [FIRApp configure] to your application
initialization.
I don't call the Firebase classes anymore and I don't want to use them.
Why am I having Firebase even if I didn't add them? Why am I having this error? How can I resolve this? If I delete the packages will that cause a problem?
Google Analytics is not recommended anymore for mobile applications:
The Firebase SDK is the recommended method to track iOS apps.
And AFAIK, the development of the features + pod maintenance is not a priority as they fully shifted towards Firebase.
I know some legacy code has to remain on GA because of outstanding history of logs. But if you have a fresh app, I strongly recommend doing analytics with Firebase.
The Google pod depends on Firebase. Change your Podfile to directly depend upon GoogleAnalytics without the slash.
pod 'GoogleAnalytics'

iOS Rejection due to Google SignIn. Latest Google SignIn (4.0.0) goes to safari

our app got rejected by apple for
Design - 4.0
We noticed that the user is taken to Safari to sign in or register for
an account when logging in with Google+, which provides a poor user
experience.
Next Steps
Please revise your app to enable users to sign in with Google+ in the
app. You can do this by updating to the latest Google+ SDK.
We recommend implementing the Safari View Controller API to display
web content within your app. The Safari View Controller allows the
display of a URL and inspection of the certificate from an embedded
browser in an app so that customers can verify the webpage URL and SSL
certificate to confirm they are entering their sign in credentials
into a legitimate page.
I am using pod and have the latest Google SignIn library, not a GooglePlus one.
The library 4.0.0 (15/05/2016), says on release notes
https://developers.google.com/identity/sign-in/ios/release
Removes allowsSignInWithBrowser and allowsSignInWithWebView properties
from GIDSignIn.
That means that I don't have a way to force it on iOS 8 to have the default iOS 9 behavior (Open a safari like browser within the app). Having installed Google App or Google+ App makes no difference.
Tried to downgrade to 2.4.0 using cocoa pods but it says
Analyzing dependencies [!] Unable to satisfy the following
requirements:
Google/SignIn (= 2.4.0) required by Podfile
Google/SignIn (= 2.4.0) required by Podfile
Any ideas?
Thanks in advance
Finally I managed to make changes and get it aprooved by downgrading to GoogleSignIn 3.0.0 which has
allowsSignInWithBrowser and allowsSignInWithWebView properties
Which I make use of with
allowsSignInWithBrowser = NO
allowsSignInWithWebView = YES
Had to change the pod file to this in order to make everything build (having google analytics too made the thing so much difficult, cause of dependecies).
Hope Google Engineers update the SignIn 4.0.0, because I don't like having old libraries, but I can't have my app rejected until Google Changes the libs
pod 'Google/Analytics'
pod 'GoogleSignIn', '3.0.0'
pod 'Google/SignIn'
pod 'Google', '2.0.4'
pod 'GoogleAppUtilities'
pod 'GoogleAuthUtilities'
pod 'GoogleNetworkingUtilities'
Good luck to you guys too,
Thanks Paulw11, he made a test project and saw the same problem in iOS8.
also, telling reviewers that other (even big) apps in App Store are usign webview even if iOS9, not only iOS8, did not help, because they said this cannot be a reason for other apps to be, and they are working hard to reject other too.
If Any changes made, for example a new GoogleSignIn library, please make a new answer!

Error setting up Firebase in Xcode

I have tried to set up Firebase to work on Xcode using both the quick setup instructions and the manual alternate instructions on Firebase website.
When I used CocoaPods and followed the instructions on the quick setup page, I was able to import Firebase, but I was not able to reference Firebase inside the class. I got the error: Cannot call value of non-function type 'module' xcode
When I tried to set it up manually, I was not able to import or reference Fire base and I got the error: No such module 'Firebase'
I had the same issue when updating my project to the new version of Firebase. A TON of changes were announced at Google I/O and thus there is a good amount of updating to be done.
It sounds like you might be using the old version of Firebase with the new SDK. You should do everything with Firebase 3.0. Hence var rootRef = Firebase(url:"https://<YOUR-FIREBASE-APP>.firebaseio.com") will now be var rootRef = FIRDatabase.database().reference().
Take a look at the setup guide at: https://firebase.google.com/docs/ios/setup#prerequisites (be sure you aren't looking at the legacy docs!). If you want to convert code from the old version of Firebase to 3.0, check out the Upgrading tutorial: https://firebase.google.com/support/guides/firebase-ios#get_a_database_reference_numbered
You should try to manually edit your podfile to something like:
use_frameworks!
pod 'Firebase/Core'
pod 'Firebase/Database'
pod 'Firebase/Auth'
I use these directives to get it working with Xcode 7.3.

Resources