Can sinch api be used with swift - ios

Can we use sinch api to create an instant message app in swift? I tried to import sinch framework in a swift app but after importing I could not import the sinch class into my application. Help please.

Use CocoaPod to install your framework, might be easier.
how to install Pod
in your podfile
target 'YourApp' do
pod 'SinchRTC ', '~> 3.1.0'
end
open the YourApp.xcworkspace with xcode.
Now, In your file you will just have to import something like
import Sinch
and it might be good.
CocoaPod is really usefull for dependencies. it help you to install / uninstall framework very easily. it's also very nice when you work in team.
Note : change YourApp by your target name

Related

No such module 'Firebase' - Xcode and Swift Package Manager

I'm trying to incorporate Firebase Analytics into my SwiftUI project in Xcode. I've added the Firebase package using Swift Package Manager, and am able to call FirebaseApp.configure() to initialize my app in my UIApplicationDelegate class. Now I'm trying to log analytics events and am running into an issue.
My UIApplicationDelegate class is in an iOS-specific folder. I have a service class that is in a Shared folder (to be used across both iOS and macOS builds). In my service class, I've added a line that says:
import Firebase
However, when I go to build my iOS target I get an error saying:
No such module 'Firebase'
I don't know why this import statement would cause a problem, since I have the very same statement in my UIApplicationDelegate class. The only thing I could think of was that somehow my Shared classes don't know about Firebase? Maybe? When I view the iOS target in my project it shows that the FirebaseCrashlytics and FirebaseAnalytics frameworks have been added to it.
I'm at a loss as to what's happening. All other things I've found online are for Cocoapods, which I'm not using for dependency management. I'm leveraging the Swift Package Manager for this. Any help would be greatly appreciated!!
I had the same issue but the post below from GitHub should fix it:
https://github.com/firebase/firebase-ios-sdk/issues/9014#issuecomment-979489434
After installing the Firebase swift package, make sure you add the Firebase libraries to Frameworks:
TARGETS -> Your App -> General -> Frameworks, Libraries, and Embedded Content -> hit '+' to add the Firebase libraries you want:
I had the same error but with 'FirebaseCore'. I tried everything, but what worked for me was to add #_implementationOnly to import. So it should look like this:
#_implementationOnly import FirebaseCore
Here is the link that helped me and it says:
You could use #_implementationOnly import for the modules from the
third-party SDK if you aren't using anything from that SDK as part of
your module's public interface.

Differences BW Facebook Login and FBSDKLoginKit Pod and which one to use?

I was trying to integrate facebook login in my iOS app. I am reading the official docs for this purpose.
On this getting started link. Documentation say to use the following pods
pod 'FacebookCore'
pod 'FacebookLogin'
pod 'FacebookShare'
So i understood that i have to use pod FacebookLogin and that's it.,
BUT
On this iOS login Docs page, Docs say to use
pod 'FBSDKLoginKit'
I am totally confused about which one to use.
What's the difference between the two?
Note: I just want to perform facebook login in my app and nothing else.
If you are using swift then use 'FacebookCore' and FacebookLogin'.
For objective C use 'FBSDKLoginKit'.
But if you see internally in podfile, they use objective C code via bridging.
You should use below pods for Login with Facebook using Swift
pod 'FacebookCore'
pod 'FacebookLogin'
pod 'FacebookShare'
Because in their official documentation's guideline for integrating Facebook Login in Swift they have mentioned those pods, so there may be some difference which they made for Swift and that's why they provide separate pods. You can assume pod 'FBSDKLoginKit' is for Objective-C because they shown Objective-C sample code on that page. Otherwise officially they haven't made any notes or declaration about these differences.
As of November 2019 the standalone swift SDK has been deprecated in favor of a single repository.
Therefore, it you should be using FBSDKCoreKit, FBSDKShareKit and FBSDKLoginKit with Cocoapods.
We plan on archiving this repo on November 1, 2019. This gives users one month to follow the instructions below for migrating to the new source code location. At this time we will also deprecate the CocoaPods FacebookCore, FacebookLogin, and FacebookShare.
The current documentation is a little bit confusing, as this section is actually referring to Swift Package Manager, not Cocoapods.
For projects that include Swift, use 'FacebookCore', 'FacebookLogin', and 'FacebookShare'
For projects that do not include Swift, use 'FBSDKCoreKit' 'FBSDKLoginKit' and 'FBSDKShareKit'

Can't find Firebase's PhoneAuthProvider class

I'm working on adding a phone authentication login to my app, but my xcode just can't find the PhoneAuthProvider class. I have included
import Firebase
import FirebaseAuth
and the right pods installed
pod ‘Firebase/Auth’
pod ‘Firebase/Database’
pod ‘Firebase/Core’
Any idea to why it's not available for me?
Apparently it was because my Firebase pods were outdated, after updating them to the newest version I was able to use the class.
To update your Firebase pods, go to terminal and type in
pod update Firebase/Auth
I'm gonna leave it here as I've found a few similar questions without any answers.
It's a problem in creation or config project or app. You need just need go:
project-> add another app
and redo all process that you can create app.
In my case that worked.
Note: don't create another project because Firebase only provide 3 project to create.
You need to go to Project> Clean Build Folder. Build the project. This fixes my problem.
In my case I had to close whole XCode and then open it again, and everything worked fine.

Integrating Parse in App extension

I’m trying to implement parse functionality in a app extension. The main app uses Parse to push and retrieve data. The problem is I can't install the parse SDK to my app extension. Is this even possible? I've been on google for about three hours and I’m starting to think not. I've tried to init another pod file and I’ve tried the the abstract_target function. No matter what I do, I can't seem to import it. Has anyone achieved this before? Im using swift 2.0 if that helps.
If there is another way to carry out the following, please let me know:
(This happens in the share popup view)
1.Grab user input text
2.Push it to the parse backend
in order to use Parse ios SDK in your app extension you are require to do the following:
enable local data store (local data store is where your data is being saved locally on your device)
Enable app groups and keychain sharing in both of your targets (your main app and your extension) this allows you to share the data and the session between your app and your extension.
When i did it. I follow this guide which explain how to integrate apple watch and app extension with parse IOS SDK.
If you are using CocoaPods in your project please make sure that you load the Parse pod also to your extension..
so let's assume that the only pod that you have in your Podfile is pod 'Parse' you Podfile should look like the following
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
def my_pods
pod 'Parse'
end
# Change the MainAppTargetName to your main app target
target 'MainAppTargetName' do
my_pods
end
# change MyExtensionTargetName to your extension target name
target 'MyExtensionTargetName' do
my_pods
end

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