FBSDKcorekit shared application is unavailable - ios

I am using Pod and all are the lastest version
Using
Pod onesignal
Pod facebook login
Target ‘onesignalnotificationextention’do
Pod ‘onesignal’
end
Onesignal is an notification service extension
Facebooklogin is working when onesignal are removed
But it give this error when both are used
‘sharedapplication’ is unavailable:not available on ios(app extension) -use view controller based solutions where appropriate
How to solve this?
Error in code
This is in FBSDKAppEvent.m
Uiviewcontrollwr *vc =[uiapplication sharedApplication].keyWindow.rootViewcontroller.presentedViewcontroller;
please help, i can't find anything?

so i solved this problem
the problem was that i only
set
require only App-Extension-Safe Api to no
in myproject.xcodeproe and the targets
it seemed the all the facebook pods were to yes
so i have to set no for all xcodeproject,target,all facebook pods
you can find require only App-Extension-Safe Api
in build setting for pods,target,and project
important note when ever you reinstall pods they are reseted to yes

Related

Setting clientID for GIDSignIn in iOS app crashes

I try to use GIDSignIn in my iOS app (ObjC). But when I do
[GIDSignIn sharedInstance].clientID = GID_SIGN_IN_KEY;
in my app-delegate, I get and error unrecognized selector sent to instance.
I'm using cocoapods to load the framework
pod 'GoogleSignIn'
pod 'GTMAppAuth'
pod 'AppAuth'
I configured the URL-scheme in my info.plist as described in the docs.
I'm building the app for iOS 14.
As suggested in countless posts on the web, I load libz.tbd, SystemConfiguration.framework, StoreKit.framework, AddressBook.framework and I set -ObjC in my other linker flags.
Alas, I'm still getting this error.
Any Ideas?
So, it turns out the Google docs for the Youtube-API are outdated (again).
I had to use dependencies (github) instead of the pod-version of GIDSignIn. Then the signup-process worked.
Uploading a video was another pain in the a** since the docs use an outdated version of the GIDGoogleUser…
I will spare you my rant on Google now…

OneSignal integration in iOS 8.0 Swift

I tried to integrate onesignal push library with my iOS app by followng their tutorial(https://documentation.onesignal.com/docs/ios-sdk-setup). However after adding OneSignal pod using cocoapods I'm getting following error
/Pods/IQKeyboardManagerSwift/IQKeyboardManagerSwift/IQKeyboardManager.swift:514:35:
'shared' is unavailable: Use view controller based solutions where
appropriate instead.
IQKeyboardManagerSwift is another pod added using cocoapods.
I tried various solutions mentioned in Stackoverflow but nothing worked. Is there anyway to fix this issue permanently?
Skip the 1st step (1. Add Notification Service Extension) in the tutorial. Then it will run without any issue.

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.

Push notification with OneSignal: What means "No Push Token"?

I'm using OneSignal for push notifications.
In the subscribed list some devices/users are marked with No (No Push Token). Explanation says: This user has no push token and cannot be targeted.
That occurs for iOS devices as well as for Android devices.
What does it mean? Why does it happen? How to change it?
This means OneSignal did not get a pushToken from the device however the device was able to register with your OneSignal account. On iOS the pushToken is known as the device token, on Android this is the Google registration id.
Depending on the OneSignal SDK you're using there is a setLogLevel function that can be called before you call OneSignal init to add additional logging. This will be printed in the Xcode log for iOS or adb logcat for Android. Also make sure you are using the last OneSignal SDK.
You can also contact OneSignal through the help bubble on the bottom of the page while logged in and they can check your account to help diagnose the issue.
Could you check if the "Push Notifications" capability is turned on? If it is not, turn it on and see if it works, otherwise keep reading.
Make sure you're running the latest version of the OneSignal SDK (2.1.14)
as this version should have resolved the issue. Next, try the following fixes:
Fix 1
From the navigation panel, select your top blue project. Then select your target and navigate to the Build Settings. Search for other linker flags and add the following entry: -ObjC
Do a project clean and run again, see if it works.
Fix 2
In your bridging header (if you have one), or on any header file that is visible to your App Delegate, create an extension for OneSignal class in which you define the following interface method:
+ (void)didRegisterForRemoteNotifications:(UIApplication*)app deviceToken:(NSData*)inDeviceToken;
Next, override the didRegisterForRemoteNotifications delegate method in your app delegate and call the above method on OneSignal and pass both parameters to the SDK.
Note that there was a pretty significant flaw in the OneSignal SDK when used in XCode 8 up to version 2.1.10 that resulted in these No push token registrations for iOS devices when including the package using Cocoapods (the recommended approach). Make sure you update your pod.
See the release notes for 2.1.11:
Fixed a 'No Push Token' issue in 2.1.10 that would happen when OneSignal was downloaded through CocoaPods and included other pods that used the -ObjC flag.
Make sure that your Xcode project has "Push Notifications" and "Remote notifications" enabled.
As other answer mentioned, there is a bug in 2.1.10 for CocoaPods setup. So I changed
from
pod 'OneSignal' ## points to 2.1.10
to
pod 'OneSignal', :git => 'https://github.com/OneSignal/OneSignal-iOS-SDK.git', :branch => 'master'

issue using FBSDK in swift iOS application

I am coding an iOS 8 app in swift using the FBSDK to allow users to log in to my app. So far I have successfully implemented the login feature using the FBSDK v3.25 in swift using a Bridging-Header.h file and updating the info.plist accordingly to the instructions given on the FB developers website. Now I want to make an app (or update my current one) to FBSDK v4.01 but when I follow the same process of integrating it into my app I get the following errors:
-> FBSDKAppLinkResolver.h
/Users/danieloram/Desktop/IOS/SWIFT/FBLoginUsingSDK4/FacebookSDK/FBSDKCoreKit.framework/Headers/FBSDKAppLinkResolver.h:21:9: Include of non-modular header inside framework module 'FBSDKCoreKit.FBSDKAppLinkResolver'
/Users/danieloram/Desktop/IOS/SWIFT/FBLoginUsingSDK4/FacebookSDK/FBSDKCoreKit.framework/Headers/FBSDKAppLinkResolver.h:21:9: Include of non-modular header inside framework module 'FBSDKCoreKit.FBSDKAppLinkResolver'
-> Bridging-Header.h
/Users/danieloram/Desktop/IOS/SWIFT/FBLoginUsingSDK4/FBLoginUsingSDK4/Bridging-Header.h:12:9: Could not build module 'FBSDKCoreKit'
/Users/danieloram/Desktop/IOS/SWIFT/FBLoginUsingSDK4/FBLoginUsingSDK4/Bridging-Header.h:13:9: Could not build module 'FBSDKLoginKit'
/Users/danieloram/Desktop/IOS/SWIFT/FBLoginUsingSDK4/FBLoginUsingSDK4/Bridging-Header.h:12:9: Could not build module 'FBSDKCoreKit'
->FBSDKLoginButton.h
/Users/danieloram/Desktop/IOS/SWIFT/FBLoginUsingSDK4/FacebookSDK/FBSDKLoginKit.framework/Headers/FBSDKLoginButton.h:21:9: Could not build module 'FBSDKCoreKit'
Failed to import bridging header '/Users/danieloram/Desktop/IOS/SWIFT/FBLoginUsingSDK4/FBLoginUsingSDK4/Bridging-Header.h'
The most obvious thing to note is the last error which says the bridging header cannot be found but it is in the same place as it was for when I was using FBSDK 3.25?
Also, all of the documentation and tutorials on the FaceBook developers website are all in obj-c so finding a solution has been a very frustrating process. Can anyone help diagnose what i am doing wrong? Any help is appreciated!
update
for the time being I have managed to compile my app by following the instructions in the Facebook developers portal and removing all modules from the FBSDK by running the following in terminal
rm -r ~/Documents/FacebookSDK/FBSDKCoreKit.framework/Modules/
rm -r ~/Documents/FacebookSDK/FBSDKLoginKit.framework/Modules/
rm -r ~/Documents/FacebookSDK/FBSDKShareKit.framework/Modules/
this is my workaround until a proper fix is released.
This is a bug and Facebook is currently "assigning this to the appropriate team".
To get updates to this issue follow this link:
https://developers.facebook.com/bugs/362995353893156/
and hit subscribe.
Some people have found success using the answers on this link (none have worked for me):
Facebook iOS8 SDK build module error for FBSDKCoreKit
For those of you trying to compile a swift project with FB cocoaPods.
*BTW, it worked once, only in xCode 7.1 it stopped
Only after playing with everything, I did 2 things:
Added the following code at the end of the pod:
post_install do |installer|
installer.pods_project.build_configuration_list.build_configurations.each do |configuration|
configuration.build_settings['CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES'] = 'YES'
end
end
Remove the 'new and improved' swift imports, and add FB into the obj-C bridging header:
A small screenshot of my bridging header
Try with build settings. Set Allow Non-modular Includes in Framework modules to YES.

Resources