I am working on a Xamarin Forms application and using an iPhone simulator to test the Firebase authentication using phone number. I have checked all project setup needed on to Console and inside the app but I am getting the
Method name: DidReceiveRemoteNotification
Information: {
"com.google.firebase.auth" = {
warning = "This fake notification should be forwarded to Firebase Auth.";
};
}
all the time. I know that because I am using a simulator I will have to go through recaptcha process for this that has also been done (Added Url Scheme for that). Any help or suggestion that can help me to get this problem sorted will be a great help.
Related
I’ve implemented firebase email authentication in iOS. I’ve tested the functionality on 4 different iPhones, all running iOS 13.3.1, and it works in half of them and not in the other. For the half that don’t work, I receive an error message stating “Invalid Dynamic Link - Blocked”. I’m performing the same process on all iPhones and am connected to the same WiFi. I’m trying to understand what would cause this to happen? It’s clearly something on the phone that is preventing it from segueing back to the app after authenticating.
I had the same problem and in my case, it was that I didn't set the dynamicLinkDomain (it isn't on the firebase example).
let actionCodeSettings = ActionCodeSettings()
actionCodeSettings.url = URL(string: "https://XXXXXX.page.link")
actionCodeSettings.dynamicLinkDomain = "XXXXXX.page.link"
actionCodeSettings.handleCodeInApp = true
actionCodeSettings.setIOSBundleID(Bundle.main.bundleIdentifier!)
I'm working with Ionic3 and using FirebaseX Cordova Plugin (because firebase plugin it's not working at all) and when the App is foreground (opened) the message get in the App (not as a notification) perfect, but when in background (using another app) the notification don't show... when I open back the App, the message get in the App (not as a notification)...
I'm using the Author example EXACTLY (only changed the bundle id so I could register as a Firebase Project)
I use a paid developer account, I have defined a APN, uploaded to firebase etc.
Activate the Remote Notification in Capabilities (both on Push and Background)
But still...
Something strange is that when the App opens, it says in the log:
2019-10-25 11:20:50.152424-0300 FirebaseX Ionic 3 Example[560:180512] FCM direct channel = true
and when the App goes background, the login says:
2019-10-25 11:20:50.152424-0300 FirebaseX Ionic 3 Example[560:180512] FCM direct channel = false
And when I open the App again it goes back to true again, and receive the notification!
I know that FCM is Firebase Cloud Messagin, so... but I don't know why it turns false
Please, help! Thanks!
I found the solution! Maybe it helps someone... Now with the FirebaseX Cordova Plugin You need to ask for permission explicitly (with the old firebase cordova plugin, was automaticly asked...)
insert this code:
this.firebasePlugin.grantPermission(function(hasPermission){
console.log("Permission was " + (hasPermission ? "granted" : "denied"));
});
and that's it (if the user say 'yes'!)
In firebasex cordova plugin you have to ask for permission like this.
You can only call grantPermission() if hasPermission() returns false:
window.FirebasePlugin.hasPermission(function(hasPermission){
if(!hasPermission){
window.FirebasePlugin.grantPermission(function(permissionGranted){
if(permissionGranted){
console.log("Permission granted");
}else{
console.warn("Permission denied");
}
});
}else{
console.log("Permission already granted");
}
});
I'm using the iOS LinkedIn SDK to log into my App and retrieve basic profiles.
All works perfectly fine the first time I login, until either I log out, or I close my App.
On attempting to log back into my App with LinkedIn: the usual redirect to the LinkedIn app takes place, but the permissions screen for my app doesn't pop up, it just redirects straight back to my app with the following error:
Error Domain=LISDKAuthError Code=5 "(null)" UserInfo={errorDescription=The operation couldn’t be completed. Software caused connection abort, originalDomain=LISDKServerError, errorInfo=PARSING_ERROR}
I can only successfully log back in again if I first close the LinkedIn App, before reopening mine.
Does anyone have an idea of what's going on please?
-This doesn't occur on all of my test devices!
-On the device that it does occur on, I also receive the same error in that scenario when running the sample App provided with the LinkedIn SDK.
-The LinkedIn App is up to date.
-The App id, bundle ids etc etc are all set, hence login success half of the time!
-I've tried calling [LISDKSessionManager clearSession] in numerous locations.
Cheeky framework fix alert.
Uncomment out the lines in LISDKSession.h
This allows the correct use of [LISDKSessionManager hasValidSession]
Which is an improvement on what we were working with.
Not yet tested with iOS12...
I had a similar problem. It was mainly reproduced only on iOS 12. The problem is that when you already have a LinkedIn application running, you will not be able to log in through their SDK in your application. On iOS 11, the second time you try to log in after this error, the authorization worked fine.
I solved this issue by simply showing the user an alert with a message about what he needs to do to authorize.
Here you can check an example of my implementation in Swift 4:
LISDKSessionManager.createSession(withAuth: ["r_basicprofile"],
state: nil,
showGoToAppStoreDialog: true,
successBlock: { _ in
// Your actions in case of successful authorization
}, errorBlock: { error in
guard let nsError = error as NSError? else {
return
}
if #available(iOS 12.0, *),
nsError.code == LISDKErrorCode.SERVER_ERROR.rawValue {
// Show alert to user with text - "Please, shut down the LinkedIn app and try login again"
} else if nsError.code != LISDKErrorCode.USER_CANCELLED.rawValue {
// Handling when user tap on Cancel button in LinkedIn SDK
}
})
I've been battling for a fix for this with LinkedIn for months.
There 'solution' is to kill off the SDK.
Taken from their 'Important updates to the LinkedIn Developers program and APIs' email December 2018:
"Authentication, SDKs, and Plugins: We are also deprecating several obsolete or seldomly-used products and technologies."
"SDKs: Our JavaScript and Mobile Software Development Kits (SDKs) will stop working. Developers will need to migrate to using OAuth 2.0 directly from their apps."
Uncomment this two lines of code in LISDKSession.h
- (LISDKAccessToken *)getAccessToken;
- (void)setAccessToken:(LISDKAccessToken *)accessToken;
I'm building an iOS app that needs to have notifications display every time any user of that app does something like send another user a message. What I have currently is a working Ruby on Rails and Android app. The Rails app notifies Firebase when a notifiable activity occurs like so:
if active_time.save
fcm = FCM.new("AIzaSyDhMXi3797t2oZMxOTo-Nph8IoypRL8Ooc")
registration_ids = Array.new
for user in group.users do
if not user.token.nil?
registration_ids.push(user.token)
end
end
options = {data: {score: "123"}, notification: {body:"Active time added to " + group.name, title: "Groupsync"}}
response = fcm.send(registration_ids, options)
active_time.delay(run_at: active_time.start.getutc).send_group_live_notification
What I'm unsure about is how to get my iOS client to notice these activities and display notifications like its Android counterpart. I have set up FCM on the iOS client and am able to send notifications, just not sure what the next step is in terms of making the link.
EDIT: I should mention for the above piece of is controlled by my iOS client through HTTP POST requests
I recommend you using a service line OneSignal. It's free and you can set a lot of platforms there, between android, ios and web browsers. For ios you're gonna need a push certificate from apple (see more here: https://medium.com/#ankushaggarwal/generate-apns-certificate-for-ios-push-notifications-85e4a917d522). Once you set your configs for android and ios, for example, you can use their api and send the notifications using their ruby gem, for example (https://github.com/tbalthazar/onesignal-ruby).
Good luck!
I am working on an app using Monaca where I need to be able to push notifications to users of the app. I tried getting the monaca push back-end working, and that wouldn't work, the app didn't register. I then moved to using the standard cordova plugin, so I can push directly from my servers, without using monaca's back-end. when I call the init function, normally a register event will fire, this works fine when I build the app. However I very much want to get the custom debugger working, I am able to build the custom debugger, and I see the plugin properly installed. Also the init function gets called, as soon as it is called I get the standard IOS security alert to grant the app permission, however the register event is not fired, therefore I am unable to get the device ID to push to the custom debugger app. Has anyone been able to use push notifications with the custom debugger application?
Best,
Peter
(https://github.com/phonegap/phonegap-plugin-push)
P.S, i calls to set the badge count setApplicationIconBadgeNumber works fine in the debugger. I think this is something simple, maybe with the certs? I dont get any errors fired, no notifications no clues using the standard debugger, how can I hunt down what the issue is?
I can get it work using ngCordova, which is AngularJS integration.
http://ngcordova.com/docs/plugins/pushNotifications/
Then, inject it like
var app = ons.bootstrap('myApp', ['onsen', 'ngCordova']);
Get back to me if you need further clarification.