How to integrate ObjectiveC framework (IronSource) into Flutter (iOS Swift)? - ios

I'm trying to integrate IronSource SDK in a iOS Flutter project (Swift project), but I am unable to do that. According to the IronSource documentation, I must point to IronSource.h file to include the bridge I need. And I am able to implement it in normal Xcode swift project, but I am unable to do that in flutter project since this bridge is already used by the flutter and it can be only one file.
So the question is: How can I integrate another ObjC library (IronSource) in the existing flutter ios project?
I am new to iOS development and Im battleing this for about a week now. I cant find anything on the internet that would work so any help will be much appreciated. Thanks

I managed to resolve my issue. It turns out that build paths are not case sensitive and I was using 'ironsource' for my plugin name but IronSourceSDK is using 'IronSource' so it looks like at build time it did not find the correct files.
And when this was working, I had to add 'use_frameworks! :linkage => :static' in the pod file of the plugin.
Then I could depend on it in my swift flutter app normally as any other plugin.

Related

How to use Swift Pod in Unity exported iOS App

I have reach experience in iOS native app development, My company have a unity app. Unity app developer exported the app for iOS and shared with me. I wanted to use my own created cocoa-pod library (which I have already using in my another iOS App) into Unity iOS project.
So Unity developer exported by File -> Build Settings, choose iOS and click Build, and now I am trying integrated pod (which is written in Swift 4.2) into Unity exported of iOS project.
I have taken medium post and many more reference, I have implemented the same as conclusive direction. Please look the attached screenshot below.
Reference - https://medium.com/ios-os-x-development/swift-and-objective-c-interoperability-2add8e6d6887
Please look the below screenshot for autogenerated file
Now when I am going to import this autogenerated header file to make connection between Objective C to Swift, then it is showing error as attached screenshot below
Please help me to resolve this issue. Thanks in advance.
One thing that has hung me up on this in the past is if you get an error during the initial build, then sometimes it doesn't create the -swift.h file and then subsequent builds also get an error that it's missing. Make sure you've deleted your derived data and cleaned the build folder to reset so everything gets built from the beginning.

Integrate Flutter into CocoaTouch SDK?

I was able to follow the instructions on https://github.com/flutter/flutter/wiki/Add-Flutter-to-existing-apps to add Flutter as a dependency to a simple single view app and display a FlutterViewController, but did not have success trying the same process for a cocoa touch framework that depends on Flutter.
Is this currently possible? My hope was to be able to build a standalone iOS SDK that is powered by Flutter that other iOS apps could depend on with no direct dependency on Flutter.
Specifically when I tried the SDK approach, Flutter imports failed to resolve with errors relating to not being able to find the Flutter module imports:
[Xcode build error][1]][1]
error: no such module 'FlutterPluginRegistrant'
import FlutterPluginRegistrant
error: no such module 'Flutter'
import Flutter
Update:
These are the error logs I was seeing initially, but was able to get around them by vendoring the FlutterPluginRegistrant.framework and Flutter.framework with Cocoapods. With that my main app compiles fine when linked to my FlutterSDK framework that includes the flutter dependencies. The issue I'm running into now is with setting up FlutterViewController and it's FlutterEngine / FlutterDartProject to point to the correct paths within the framework for the flutterAssets / dartMain / packages urls. I'm not sure how to pull these in from the framework.
If you want to build a Framework that is essentially _just_ a Flutter module, where other iOS apps can use it without having to install/depend on Flutter SDK themselves, then yes, this can be done via one of the flutter/add-to-app options for iOS:
Option B - Embed frameworks in Xcode
also refer to the github/flutter/ios_using_prebuilt_module sample
On the other hand, if you are talking about integrating Flutter into an existing Framework, Flutter + Cocoa Touch, then no, this is currently not supported, but is being explored:
https://github.com/flutter/flutter/issues/39027
note that this would be termed “add-to-library” as opposed to "add-to-app"
also mentioned, flutter/add-to-app:
Packing a Flutter library into another sharable library or packing multiple Flutter libraries into an application isn’t supported.

How to integrate GTM with Firebase analytics enabled Application which developed using Xamarin Android platform

I am developing Mobile application using Xamarin Android. We have integrated Firebase portal with our application successfully. Also we are able to see all automated event and custom event on Dashboard in firebase Console.
Now my requirement is to integrate Google Tag Manager(GTM) SDK with existing Firebase SDK in my application. I tried to integrate by following some below links
https://developers.google.com/tag-manager/android/v5/
https://github.com/IdoTene/XamarinTagManagerAndroid
but ended up with build error Invalid Resource file Name for GTM configuration file(GTM-XXXX.json).
So here is my question, How to integrate GTM SDK with Firebase SDK in Xamarin Android application.
Please any help would be greatly appreciated.
I don't know if you figured it out eventually, but for future reference, the problem is that the IdoTene tagmanager project is for tagmanager v4, which is pre firebase. Instead you should use the version that Xamarin maintains:
https://www.nuget.org/packages/Xamarin.GooglePlayServices.TagManager/
The steps are very simple. Integrate GTM containers (ios and android) as follows:
For Android -> create subfolder in assets folder and name it as containers, copy container in it (make sure it's naming starts with GTM-xxxxxx.json).
For iOS -> create a folder container in the root directory and copy GTM container json there (GTM-xxx.json)
Then install Xamarin.GooglePalyServices.TagManager nuget for Android and Xamarin.Google.iOS.Tagmanger for iOS.
Thats it for Android, but for iOS, there is a one more step.
Integrate following code in AppDelegate.cs
Google.TagManager.TagManager.Configure();
Then you should be good to go!! :)

Xcode compile error with Firebase

I just installed the Firebase framework to Xcode (not using CocoaPods due to other unsolvable issues with that). I followed the Firebase Alternative Setup instructions from here (manually dragging the FireBase 2.5 Framework to my project).
Problem is, when I compile my app I get 27 errors:
screenshot
I'm just using the sample code from the Getting Started page.
In fact, all I'm using so far is the first line, but it won't even instantiate that. (var ref = Firebase(url:"my firebase URL here")
I'm on Xcode 7.2 and Swift 2.1. My target is iOS 9.2 using the Simulator.
Please help!
Thanks.
PS.
I should also add that libicucore.dylib and libc++.dylib no longer appear to be available as linkable libraries that you mention to include from firebase.com/docs/ios/alternate-setup.html So maybe this is related? Someone mentioned libz.tbd is the one to use now? (which I'm using)
If you are targeting 9.2 then the frameworks changed to the following:
libicucore.dylib to libicucore.tbd
libc++.dylib to libc++.tbd
They are exactly the same so use them instead, you have to use them in order to get it working.
A comment by apple:
For those who are curious, the .tbd files are new "text-based stub
libraries", that provide a much more compact version of the stub
libraries for use in the SDK, and help to significantly reduce its
download size.

installing AWS ios sdk in swift project

I'm trying to add the AWS SDK to my xcode project that is written in swift.
I followed these steps: http://mobile.awsblog.com/post/Tx2AA7ZHB1FK0G1/Version-2-of-the-AWS-SDK-for-iOS-Developer-Preview to create a Bridge-Header file, and add the SDK itself to my project.
The problem is that when I try to build the app I get an error now... the Bridge Header cannot be imported because one of the files in the AWS SDK (AWSModel.h) has an error. This file tries to import Mantle/Mantle.h, and the error reads "Mantle/Mantle.h file not found"
do I need to add this file to my project as well? If so, how would I go about doing that? The only frameworks I'm using are Facebook SDK, and I would like to add AWS as well.
There is a working sample app on GitHub. You should follow README and see if you can compile the app. It should help you understand how to set up the project.

Resources