firebase_admob - when using this plugin strictly for ads, pod unnecessarily installs firebase core and other plugins only on iOS side - ios

I use firebase_admob plugin in my flutter project and don't intend to include any other firebase related plugins like firebase_analytics, firebase_core, etc. So, my android side of the development seems very neat and all the Ads implementation is totally fine.
But from the iOS side, there seem to some config steps which I'm not able to narrow down. There is no proper documentation also regarding this.
Now, Correct me if my understanding is wrong.
podfile is a generated one based on the pubspec.yaml file with regard to flutter ios side. And the terminal command 'pod install' installs all the dependent plugins for iOS automatically. But here is the actual problem, instead of installing only the AdMob part as a standalone plugin, the pod installs all other firebase_core, analytics, etc too, which I don't expect. I want it exactly to be similar to the android side. Because of this, I get this Google-services-info.plist is not set up and all that which I haven't done either in android with 'google-services.json'.
Why should I have to forcibly include the google analytics part when I look only for Ads? Why there is no straightforward way to install only the AdMob part with the firebase_admob as in android.
And since the podfile is an auto-generated one pulling all the needed plugins from the pubspec.yaml. i'm not sure if I can add the standalone 'pod firebase_admob . and run pod update.
But still not sure how this will remove the other firebase plugins.
In fact, even after manually removing the dependencies from the pods.xcodeproj's target, pod update restores all the removed plugins again. How to sort this out.?

Related

Flutter Plugin -- build for iOS works in xCode, but doesn't work with flutter build because of package dependency

I am developing a Flutter plugin, which requires a third party library. This library is hosted on GitHub, and to add it to my project, they tell me to use XCode's package manager (File -> Add Packages). When I do it this way, I can use the package just fine, compile my code and run it on my iPad. However, when I try to use "flutter build ios", it doesn't work.
When building, I see a series of (with actual framework names and file names instead of ...):
note: Removed stale file ...
note: Removed stale file ...
note: Removed stale file ...
Then eventually I will see that the compilation has failed due to being unable to import the library I need. Additionally, when I go back into XCode, I find that the package dependency I had installed is no longer there.
So, what I suspect is happening, is when Flutter builds it is cleaning up all the old frameworks, and running its own pod install. However, since my package is not part of my podspec file, it is being left behind. I am unsure how to get this to work. I've tried adding a line in my podspec file like:
s.dependency 'PackageName'
s.source { :git => 'https://linkToTheGitRepo' }
and then running pod repo update, but when I go to build I still get "Unable to find a specification for PackageName depended upon by my_plugin".
At this point, I just build in XCode and then don't touch it, however this has also caused issues when I go to use the plugin later in another project -- I also cannot use flutter build ios in that project, and I have to do it through XCode. This is an annoying workaround, since I lose the hot reload ability and other nice features of working with Flutter. Any suggestions are appreciated. Thanks.

How to build a working existing react native app on iOS?

So I have an app that I have been working on for a far few months now. I developed it on Ubuntu and tested on my android phone and tablet. The app is setup using the basic react native library and I also added in expo later on for some little thing expo had that I needed. Let me know if you need more information about this.
The app is 'feature complete' and just needs to be play tested and released. So naturally I need to get it up and running on iOS. I am currently renting a mac that I can remote into (as I own no apple products).
It has been nearly a week now and I just cannot move past this error (see bottom) (or variations of what seem to be the same/similar errors). I can build a fresh app on this mac so everything is there to build react native apps. I have tried: Deleting pod and and running
pod install
running
pod deintegrate && pod install
deleting node modules and running
npm install
Initially I had an error complaining that some libraries were manually linked and this was bad so I unlinked them and now I get this error. I am opening that app using the workspace file when I run in xcode. I also get the error if running through command line i.e.
npx react-native run-ios
Using different simulators makes no difference...not sure if it is even getting that far in the build process for that to matter. I think this has something to do with the linking of RN libraries and this new auto link thing. Any thoughts? There are loads of posts with this error (or close to) that have all sorts of 'solutions', but none seem to make a difference. Overwhelmingly peoples solve this by pod install after deleting pod folder or running the pod deintegrate command. Looking at the error you can see that it prints out loads of libraries some of which I installed and others probably come with my 3rd party libraries, but some look like the core libraries and even low level looking ones that presumably RN is built on (but I honestly wouldn't know).
I was having issues before 'compiling' stuff and again I think it was to do with the linking.
Also, is there a 'react native' support service or something i.e. I pay some who knows apple and will just fix the damn thing for me
ERROR (scroll to the bottom for what is probably the important bit):
https://pastebin.com/HMdP4x3P
[EDIT]
I think this has something to do with my podfile: https://pastebin.com/5J7BbG2Q other pod files do not look like mine.

Exact steps needed to migrate a react native android app to iOS

I've written a react-native app and compiled it for android.
Now I wish to compile my app for iOS.
I've searched the internet and found a lot of documentation about adding react-native components to an existing iOS app project, but couldn't find a concrete guide/explanation on how to take an existing react-native project(with many components, packages installed etc) and add the relevant iOS configuration.
I guess that I somehow should create an iOS project through xCode,then probably copy some project files into my ios folder of my project, create a podfile corresponding to my packages in package.json, install the required stuff using pod install and then maybe I can run it using the react-native run-ios command, but I'm really not sure whether I'm correct and to do these steps.
If someone can clarify to me what are the required steps I'll be grateful! (And I think other people might find it useful as well)

Error message - RNFirebase core module was not found natively on iOS

React Native Firebase won’t install on iOS React Native project. It works fine on Android.
I followed this instruction.
https://rnfirebase.io/docs/v5.x.x/installation/initial-setup
I set up Firebase, added the downloaded plist file via XCode, installed and set up Cocoapod.
The moment I add the following line to my App.js, the simulator returns an error message.
import firebase from 'react-native-firebase';
The error message: “RNFirebase core module was not found natively on iOS”
I’ve tried a few things I picked up from this forum:
https://github.com/invertase/react-native-firebase/issues/614
I commented out following lines from Podfile
use_frameworks!
And then pod install, pod update
on Xcode, checked the Build Phases/ Link Binary with Libraries section. I checked libRNFirebase.a was already there.
I've been trying this for a few months now on and off. And I haven't found a way to make React Native Firebase install on iOS project. Any pointer would be much appreciated.
I'm currently maintaining the react-native-firebase v5 branch (current stable) and we do have a problem with the header search paths right now for some reason.
I don't have a definitive fix, but I constructed a demo that goes from react-native init, then installs react-native-firebase, and does all the things necessary such that the project builds and runs on iOS and even archives in release mode.
You may see it here: https://github.com/mikehardy/rnfbdemo
The only thing that is important at the moment is that you need to put one non-documented thing in your Podfile after following all the install instructions, as the last line before the final end
system("mkdir -p Pods/Headers/Public/FirebaseCore && cp Pods/FirebaseCore/Firebase/Core/Public/* Pods/Headers/Public/FirebaseCore/")

Failed to install phonegap-plugin-push in ios cordova 8.0

I have created a new package in Cordova 8.0 and installed all the plugins.
when adding an android platform its fine.
But when add iOS firebase-analytics and phonegap-push plugins are not installing
Either this or that only installing
If I remove phonegap-push and add pod install its added.
Or else remove firebase then add phone-gap pod is installing.
when using both plugins second one was not installing its says
Even I tried pod update, pod install, platform remove & add, plugin remove & add all the scenarios.
Does anybody have an idea please update.
Thanks
That's exactly the issue that my pull request solves. Firebase implementations are not consistent across plugins and tend to introduce these easily avoidable errors.
The pull request has not been accepted yet, so proceed like this:
Uninstall the push plugin
Download it anywhere and edit the same files I have edited
Install the plugin from the path of your local copy.
Also, if you prefer you can remove the iOS platform instead, then edit the plugin files from your project's folder, then re-add the platform. This will install the newly edited plugin with your changes included, and hopefully, without the errors.
I have fixed the incompatibility between Firebase Auth and Push Plugin by editing the files exactly as show, then removing and re-adding the iOS platform. If this solves your problem kindly send a positive feedback on the Issue tracker so the PR is accepted sooner. It's been already added to the 3.0.0 milestones.

Resources