In my application I am using facebook authentication.My code looks like
var win1 = Titanium.UI.createWindow({
title:'Tab 1',
backgroundColor:'#fff',
layout:'vertical'
});win1.open();
Titanium.Facebook.appid = "appid";
Titanium.Facebook.permissions = ['abc'];
var facebook_button = Ti.UI.createButton(
{
height:50,
width:200
});win1.add(facebook_button);
facebook_button.addEventListener('click', function(e)
{
Titanium.Facebook.authorize();
});
var facebook = Titanium.Facebook.createLoginButton({
style:'wide',
bottom:80
});
win1.add(facebook);
Titanium.Facebook.addEventListener('login', connect_facebook);
function connect_facebook()
{
alert('inside');
Titanium.Facebook.logout();
}
Now problem occur when I click on facebook_button. When I install application on android device(version 2.2) I click on facebook_button it causes forced close of application. after forced close If I again start application and use same functionality it's working fine.My log records gives following error java.lang.NullPointerException.
if I use titanium facebook button i.e. Ti.Facebook.createLoginButton it's not giving any error even on first use also. But I want to use my own customize log-in button.
I want to remove this null pointer exception. I am using android sdk 2.0.1. and tested on android device 2.2.On simulator application running without any error.Is there any way to solve this problem? need help.. thank you..
I have no experience in connecting to Facebook from Titanium, but installed one of their new example apps two days ago: https://wiki.appcelerator.org/display/guides/Example+Applications#ExampleApplications-ARti
This connects to FB, do not know in what way. You can download example code from GitHub, maybe you find it useful.
Besides, in my experience the older Android SDK versions you are using have some issues. I have better experiences using 2.3 and newer. Recently compiled an app with SDK 4.x and have it running on a device with 2.2, so no problems with backward compatibility. Maybe it helps to upgrade your SDKs.
Related
I'm working with AppsFlyer in Unity based on the following documentation: https://support.appsflyer.com/hc/en-us/articles/213766183-Unity-plugin-V4-integration-guide-for-developers
I followed the necessary steps but when it came to running the integration test, it just stayed stuck in this screen:
https://imgur.com/a/taXW909
Are there any potential things that I might be missing that could cause this issue? As far as I understand, I need to whitelist my Android device, select it in the SDK Integration Test, scan the QR Code, install my project's .apk file and the AppsFlyer should start detecting something.
Additional details
Here's the script for initializing AppsFlyer:
public class AppsFlyerObject : MonoBehaviour
{
private const string AppsFlyerKey = /* MY DEV KEY */;
private void Start()
{
AppsFlyer.setAppsFlyerKey(AppsFlyerKey);
AppsFlyer.init(AppsFlyerKey, "AppsFlyerTrackerCallbacks");
}
}
Regarding the AppsFlyer app, here're the settings I selected:
https://imgur.com/a/7PxEnlW
I want to test an APK file that is not present on any kind of a store.
Have you tried testing a non-organic install with this link?
https://support.appsflyer.com/hc/en-us/articles/207032126#integration-43-simulating-a-nonorganic-install
If everything implemented correctly, but you are still stuck on this screen - it's very likely you have 'zero plan' on your AppsFlyer account. You cannot pass this test on free plan for some reason.
I've found it after two days by connecting device via logcat and recieving 403 error. You can do same to be sure its your reason too.
I am using react-native-fbsdk in my react-native application.
I followed the official setup guide for the same. And managed to integrate it in the app.
I am using following standard code to share the link using ShareDialog
const shareLinkContent = {
contentType: 'link',
contentUrl: 'http://www.google.com',
quote: 'try this',
};
ShareDialog.canShow(shareLinkContent)
.then(
(canShow) => {
if (canShow) {
return ShareDialog.show(shareLinkContent);
}
},
)
.then(
(result) => {
if (result.isCancelled) {
alert('Share cancelled');
} else {
alert(`Share success with postId: ${
result.postId }`);
}
},
(error) => {
alert(`Share fail with error: ${ error }`); // I get the error on this line.
},
);
Above code works fine on iOS and some of the android devices.
But on some android devices i get error as Share fail with error: Error: API_ERROR: API_ERROR
Not getting what is wrong for only subset of devices
Devices i faced problems are
Google Pixel gen 1, Some SAMSUNG devices, oppo.
Devices i managed to run without errors :
Xiaomi redme note 4, google nexus 5
Thanks in advance for the help
I am also facing the same problem for my app. I am creating a react native based app that is using fbsdk. I followed the steps from React Native FBSDK. I get no error from android when I run it. The compilation is fine and the app is also running perfectly on mobile.
When I run react-native run-android I have no error and I can even see facebook loginButton. But when I click on the button, it doesn't bring me to the facebook login page most of the times. Specially in Samsung mobile series its not opening login page or sometimes i need to click multiple to the loginButton then it appears login page. In other mobiles its working fine.
I found this issue specifically in Android 8 and 9 versions of Samsung Galaxy (S6, S7, S8, S9, S9+) and Samsung Note 9 series. The issue is occurring random, means sometimes the login button is showing popup to login with facebook and sometimes not. Similarly sometimes share dialog is opening and sometimes not.
Even I tried in emulator of Samsung Galaxy (S6, S7, S8, S9, S9+) and Samsung Note 9 series, but its working fine in emulators. I cannot be able to debug the actual cause of such error. It is happening only in real device.
I have posted the same issued in React Native github repository as:
This and this
And from last 2 weeks waiting for response from fbsdk team but till now no one responded. Today I have posted the same issue on fb developers as a Bug check it here
Posting it late:
I figured out what was the problem.
The facebook app need to be published to production on the facebook developer console.
Hope it helps you all reading this.
I have developed a xamarin form app that it uses MS Graph in order to user sign in. I have used samples of GitHub that open a new browser activity where user sign in and then the app goes to home activity. It works correctly. But some users have blocked or deleted Chrome app in order to use MS Edge as default browser, and then when app tries to start the browser activity, it launches an error because it can’t find chrome activity. I have asked on MS Graph GitHub (https://github.com/microsoftgraph/msgraph-sdk-dotnet/issues/242 ) but they and I are thinking that it isn’t problem of SDK but I don’t know how I could fix it. How should I fix it in order to work with any installed browser?
Thank you
It is done by design. The Microsoft Identity Client library uses Custom Chrome tabs and does not have any fallback strategy to run using a WebView.
You are probably encountering this exception thrown when it doesn't find Chrome installed: https://github.com/AzureAD/microsoft-authentication-library-for-dotnet/blob/dev/src/Microsoft.Identity.Client/Platforms/Android/AuthenticationActivity.cs#L131
string chromePackageWithCustomTabSupport = GetChromePackageWithCustomTabSupport(ApplicationContext);
if (string.IsNullOrEmpty(chromePackageWithCustomTabSupport))
{
string chromePackage = GetChromePackage();
if (string.IsNullOrEmpty(chromePackage))
{
throw new MsalClientException(MsalClientException.ChromeNotInstalledError,
"Chrome is not installed on the device, cannot proceed with authentication");
}
#Cheesebaron is correct, this is by design. Currently, Xamarin Android in MSAL can only launch chrome or chrome custom tabs. If the device doesn't have them, it will cause an exception, as you noted above.
#cansado2930 This part of the error message pkg=com.android.chrome means Chrome is not installed on the device.
Embedded webview support in MSAL will be an option in near future.
Here's a link to the issue in the MSAL repo.
I get the trouble with using Facebook SDK on android. Below is what I have done:
I'm using Facebook sdk 5.1.0 and Unity version is 4.3.4
In Assets\Facebook\Editor\android\FacebookAndroidUtil.cs, I add
System.Environment.GetEnvironmentVariable("HOMEDRIVE") in line 62
so that "Debug Android Key Hash" can be generated.
I using C# to type the main script, in "Awake()" I add
FB.Init(SetInit, InitCallback);. It just like the tutorial from
developers.facebook.com, and enable is give out "true". (I think
that mean FB.init() is success.)
After that, I build up a GUI button for log in. I have try FB.Login("basic_infos", AfterLogin);, FB.Login("publish_actions", AfterLogin); and FB.Login("email", AfterLogin); , both the FB.isLoggedIn is false on android device.
Actually I can log in on unity environment using "User Access Token". On android device, after I press the Login button, it give out a permission and then I press "OK", nothing happen...(FB.isLoggedIn still false)
Anyone can give a help? I get the trouble a few week already...
p.s. My English is not good, please let me know if you don't understand.
I just tried a small sample worklight app on my phone to test the JSONStore, the init code for which is as follows in my file jsontest.js.
function wlCommonInit(){
var i;
var collectionName = 'exp';
var options = {};
var collections = {};
//Object that defines the 'people' collection
collections[collectionName] = {};
//Object that defines the Search Fields for the 'people' collection
WL.JSONStore.destroy(options);
collections[collectionName].searchFields = {name: 'string', age: 'integer'};
WL.JSONStore.init(collections, options)
.then(function () {
alert ("JSON Store initialization success!");
})
.fail(function (errorObject) {
alert (errorObject);
});
I'm getting the error -1: PERSISTENT STORE FAILURE when I run the app on my phone (Galaxy Nexus). The following errorObject is returned.
{
"src": "initCollection",
"err": -1,
"msg": "PERSISTENT_STORE_FAILURE",
"col": "exp"
"usr": "jsonstore",
"doc": {},
"res": {}
}
The app works fine in the Worklight console simulator and in the AVD. My phone has enough storage (600 MB left) to run the app so that shouldn't be a problem.
What am I doing wrong here? Does this have anything to do with the fact that I'm running a custom ROM?
UPDATE: I checked the app on my dad's phone (Sony Xperia Sola) and it worked! Very weird. It doesn't run on my phone, even though all other third-party apps that I have downloaded so far on my phone from the Play Store and other sources all work fine.
So, does Worklight not support custom ROMs?
The custom ROM that I am using is VanirAOSP. I applied a popular custom kernel and I'm using the Dalvik runtime (not ART or anything like that).
I also think that the problem might be because Worklight apps are not fully supported on Android 4.4 KitKat.
Would appreciate it if someone would shed some light on this.
There is an issue that affects the JSONstore when using Worklight 6.0 on Android 4.4, which causes the behavior your are seeing. You can get more information about this here:
http://www-01.ibm.com/support/docview.wss?uid=swg27040512
If you are using Worklight Consumer Edition or Worklight Enterprise Edition, you can get a fix for this issue by upgrading to Worklight 6.0.0.2 (a/k/a Worklight 6.0 Fix Pack 2).
If you are using Worklight Developer Edition, you should be able to use the Eclipse "Check for Updates" function to upgrade your Worklight 6.0 Developer Edition installation to Fix Pack 2.
Note that after applying the fix, you must remove the JSONstore feature from your application, and then add it back again; this is described in the APAR document that you can access from the page I've linked above.