I am using Blackberry Facebook SDK (FacebookBlackBerrySDK-v0.8.25.jar) for facebook integration for my app. I am using the following code.
ApplicationSettings as = new ApplicationSettings(NEXT_URL, APPLICATION_ID, APPLICATION_SECRET, PERMISSIONS);
Facebook fb = Facebook.getInstance(as);
try{
FBUserDetails fbUserDetails = FBUserDetails.getInstance();
String prevUserDatails = fbUserDetails.getFBData();
User user = fb.getCurrentUser();
if(prevUserDatails != null && !prevUserDatails.equals("") && user.getEmail().equals(prevUserDatails)){
if(Dialog.ask(Dialog.D_YES_NO,"Do you want to post using FB account " + prevUserDatails + "?",Dialog.YES)==Dialog.NO){
fb.logout(true);
user = fb.getCurrentUser();
}
}
if(user!= null){
fbUserDetails.persist(user.getEmail());
String result = user.publishStatus(decodedText);
if ((result != null) && !result.trim().equals("")) {
Dialog.alert("Successfully posted to Facebook.");
} else {
Dialog.alert("Share Failed.");
}
}else
Dialog.alert("user is equal to null.");
}catch(FacebookException fe){
fe.printStackTrace();
}
When I am testing the app in Blackberry Strom 9300 (OS version 6.0.0.526), it is running properly first time. But when I am going to share the same text again in a short interval(it is obvious that the posting will fail), system is giving "the memmory available on your device is low. Close some of the items below." and I forced to close the application. Can anyone tell me what is the problem in the above code?
I am having the same issue with my Webworks Blackberry build. The first time I begin using the app it is running fine but when I begin to process other pages on the app I receive a pop-up telling me that "the device memory is too low - please close the following items". Then the app icon changes to what looks like a folder.
I did some research and it appears this is a persistent problem on the Blackberry OS 6. Deleting the app and reinstalling it does not help neither does restarting the app.
Take a look at this link to view deeper issues related to low device memory
http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/Device-memory-is-Low-issue-for-an-WebWork-app/td-p/1166441/page/16
Related
I am integrating dynamic links from Firebase into my iOS app to reward new users with bonus points. In order to reward them I track the sender of the link and currently I am testing 2 scenarios:
First is when I open the Firebase dynamic link and I have the app locally installed on the iPhone. This case works perfectly fine, because the link is just redirecting me to the app and successfully prints the sender's UUID.
The second is when the app is not installed and the user has to download it from AppStore. In this case the link redirects the user to AppStore and when the app is successfully installed, I want to print the UUID of the sender. Unfortunately this is not possible due to the fact that WebFilter is blocking the Link which results to no information about the sender's UUID. In order to resolve the issue, the user has to click again on the link which trigers Scenario 1. But there is no point of using a dynamic links if we have to click twice.
Error message:
2021-02-15 23:56:56.453607+0100 Universal-Link-SwiftUI2.0[78267:19937175] 7.5.0 -
[GoogleUtilities/AppDelegateSwizzler][I-SWZ001014] App Delegate does not conform to
UIApplicationDelegate protocol.
2021-02-15 23:56:57.257019+0100 Universal-Link-SwiftUI2.0[78267:19936907] WF: === Starting
WebFilter logging for process Universal-Link-SwiftUI2.0
2021-02-15 23:56:57.257243+0100 Universal-Link-SwiftUI2.0[78267:19936907] WF:
_userSettingsForUser mobile: {
filterBlacklist = (
);
filterWhitelist = (
);
restrictWeb = 1;
useContentFilter = 0;
useContentFilterOverrides = 0;
whitelistEnabled = 0;
}
2021-02-15 23:56:57.257438+0100 Universal-Link-SwiftUI2.0[78267:19936907] WF:
_WebFilterIsActive returning: NO
My dynamic link object has no url
I found out this question: How to fix xcode bug "web filter is active"?
The problem is that I am sure that the link is HTTPS, so it must be something else whcih I can not find out.
I am also allowing the ATS to load everything:
and associated domains:
But it is still not loading. Any help will be very appreciated.
My full link is: https://makeitso.page.link/?link=https://www.example.com/data?hello%3Dworld%26foo%3Dbar&isi=1312965045&ibi=com.IVANDOSE.ToDoFirebase&st=It+is+apple+pie+time&sd=Get+25%C2%A3+now&si=https://upload.wikimedia.org/wikipedia/commons/1/17/Official_car_of_the_Chief_Minister_of_Gibraltar.jpeg
I need a web and mobile application which will work on android, iphone and windows as well.
I want to use facebook login for my apps and customer can like my page after login thats why i am using cordova to convert my web app into android app but i need to integrate facebook-like option which i didn't get in plugin.
So i implemented this using oglike
$scope.facebookLike = function() {
if($localStorage.hasOwnProperty("accessToken") === true) {
$http.post("https://graph.facebook.com/me/og.likes?access_token="+$localStorage.accessToken+"&object=https://www.facebook.com/Nxtlife-Technologies-Ltd-UK-180614345644169/?ref=br_rs");
alert("like sucessfully done");
} else {
alert("Not signed in");
$scope.facebookLogin();
}
}
Problem:
The code will not throwing any error but after success message it didin't make any changes to my page. like count is remains same.
og.likes is for Open Graph objects – external URLs, outside of Faceook.
You can not like Facebook pages by any other means than the official Like button.
I just installed the new version of Unity 4.3 and the new facebook sdk and I can't get it working.
I created the app on facebook, copied over the app id to the unity facebook settings as required and copied the Package Name and Class name back to facebook.
Because the Android Key Hash is empty ( even it shouldn't be ) I used the methods posted by others to create one with openssl. I created it and copied over to facebook as required.
After this I created a small script to be able to login.
// Use this for initialization
void Start () {
enabled = false;
FB.Init(SetInit, OnHideUnity);
}
// Update is called once per frame
void Update () {
}
private void SetInit()
{
FbDebug.Log("SetInit");
enabled = true; // "enabled" is a property inherited from MonoBehaviour
if (FB.IsLoggedIn)
{
FbDebug.Log("Already logged in");
OnLoggedIn();
}
}
private void OnHideUnity(bool isGameShown)
{
FbDebug.Log("OnHideUnity");
if (!isGameShown)
{
// pause the game - we will need to hide
Time.timeScale = 0;
}
else
{
// start the game back up - we're getting focus again
Time.timeScale = 1;
}
}
void OnGUI(){
if (!FB.IsLoggedIn)
{
if (GUI.Button(new Rect(179 , 11, 287, 160), "Login to Facebook"))
{
FB.Login("email", LoginCallback);
}
}
}
void LoginCallback(FBResult result)
{
FbDebug.Log("LoginCallback");
Debug.Log("LoginCallback");
if (FB.IsLoggedIn)
{
OnLoggedIn();
}
}
void OnLoggedIn()
{
FbDebug.Log("Logged in. ID: " + FB.UserId);
}
Now when I click on the login button a Facebook window appears requesting permission, after I press ok, it returns, but I'm still not logged in... Can anybody help why is this?
Another strange thing I observed that the LoginCallback gets called as soon as I click on the login button, even though I would think it should only when I gave permission. Anyway when I give permission it returns to my app and nothing happens. I can click on the login button again and same thing happens, login callback called, it asks for permisions, I give the permision and returns back, nothing happened. Can anybody help?
Version 4.3.6 of the sdk should fix this problem. It's available here: https://developers.facebook.com/ We are still waiting for it to be approved on the asset store, so the only place to get it right now is from Facebook's site.
Note - it's still broken (5/2014) IF you use a Mac. Just follow the "Rafael solution", discover your hash properly from public void OnLoginComplete(string message). Cheers
So after being frustrated for a few days with having to trace out the key to my phone, I decided to look into what it was doing.
After some research it turned out that when you published to an android device, facebook would use the keystore that was defined in your publish settings, not your .android/debug.keystore file. So I went in and changed the sdk to make it work the proper way. Essentially I changed the SDK to look at the ProjectSettings instead of the debug directory for grabbing the key hash. In the FacebookAndroidUtils.cs I added the following.
// Using the user defined keystore values instead of the debug one.
degbugKeyHash = GetKeyHash( PlayerSettings.Android.keyaliasName, PlayerSettings.Android.keystoreName, PlayerSettings.Android.keyaliasPass, PlayerSettings.Android.keystorePass );
I created a small repo that provides the fix as well as some gui changes to make it more easy to update the key hash.
Github Facebook Unity SDK 6.1 Fix
Update - Fixed a bug with OS X related to escaping spaces on the string path
Hope this helps!
Take the "email" permission out of the login function and try it. Oops I thought I seen the "publish_actions" permission in there too.
Make sure the loginactivity in the manifest is in portrait.
Instead of implementing everything yourself, try using the free and open source SOOMLA Profile plugin for all of your social network needs:
https://github.com/soomla/unity3d-profile
Also available on the asset store for download:
https://www.assetstore.unity3d.com/en/#!/content/24601
It covers Facebook, Twitter and Google+ and has a unified API for logging in, posting statues, uploading images and getting friends lists. For proper disclosure, I'm one of the founders.
hi i have unity3d and the latest facebook sdk
i've downloaded the sample project but i got a problem, when i start the project and click login, unity immediately show this images:
which i expecting i've got an error from this part of code in mainmenu.cs
if (FB.IsLoggedIn)
{
string panelText = "Welcome ";
if (GameStateManager.Username != null) panelText += GameStateManager.Username + "!";
else panelText += "Smasher!"; //I GOT THIS ELSE BLOCK !
if (GameStateManager.UserTexture != null)
GUI.DrawTexture( (new Rect(8,10, 150, 150)), GameStateManager.UserTexture);
GUI.Label( (new Rect(179 , 11, 287, 160)), panelText, MenuSkin.GetStyle("text_only"));
}
which is my gamestatemanager.username is null... i just want to know why my gamestatemanager.username is null, how to get some data to fill that.. i've followed step to fill gamestatemanager.username in this link where's my error btw ? anyone can help ?
Please see this question. Unity Facebook SDK Login Always Returns User 0 Access Token abc...z We don't support the editor or desktop yet. You will have to run on an ios or android device, or publish your app to facebook canvas.
I think you are having the same problem I am...
It seems it has logged you in but returns USerID:0 and Access Token: abcdefghijklmnopqrstuvwxyz
I think this is a TEST User that is automatically logs in but I can't seem to find out how to turn that off and to actually have it log ME on.
Is your APP in Sandbox mode? I tried turning my sandbox mode in the facebook app settings off but it didn't seem to effect it...
Waiting for an answer on this and my related question...
Unity Facebook SDK Login Always Returns User 0 Access Token abc...z
If you are running this from the EDITOR then the reason is the EDITOR does not actually log you in.
If you are running from the device...I am still working on that one (also getting the same result you are)
In iOS6 there is an easy way to present users with the option to download your app when they visit your website and are on an iOS device.
(I know how to detect the user agent, write js, ect. Just looking to see if there is a quick nice library someone wrote for this.)
But, since that is not yet available, are there any good solutions out there to let our users know we have an app, and let them download it? But also, never show the message again if they HAVE downloaded it, or closed that dialog?
EDIT:
Here is what I have used in the past, but removed it because I felt it was annoying to the user. Just looking for lightweight examples.
/**
* Checks if this device is an iphone
*
* #version $Revision: 0.1
*/
puc.isIphone = function(){
return (
(navigator.platform.indexOf("iPhone") != -1) ||
(navigator.platform.indexOf("iPod") != -1)
);
}//end
/**
* Checks if this device is an ipad
*
* #version $Revision: 0.1
*/
puc.isIpad = function(){
return (navigator.platform.indexOf("iPad") != -1);
}//end
/**
* Function that checks if we are using a mobile browser and presents an option to view a differnt site
*
* #access public
*/
puc.mobile = function() {
if (puc.isIphone() || puc.isIpad()) {
// Add link to remove cookie
$('#copyright').append('<p><a id="remove-iphone-cookie">Reset Mobile Preferences</a></p>');
// Allow Deleting of the cookie
$('#remove-iphone-cookie').click(function() {
$.cookie('use_mobile', null);
alert('Preferences have been reset.');
return false;
});
if ($.cookie('use_mobile') == null) {
var conf = confirm('Would you like to download the PUC Mobile iOS app?');
if (conf) {
document.location = 'http://itunes.apple.com/us/app/puc/id424617272?mt=8&ls=1';
$.cookie('use_mobile', 'true');
} else {
// Never ask them again, unless they empty their cookies
$.cookie('use_mobile', 'false');
}
}//end
}//end if mobile
}//end mobile
The first part of your question is easy, you can detect the user-agent on the browser (serch for iPhone, iPod, iPad, etc... More here: http://p2p.wrox.com/content/articles/identifying-iphone-safari-user-agent)
The second part of your question is where you will come up short. You will not be able to determine that the user has the app installed because Apple will not share any user info outside its ecosystem (especially over the web). So you will need to show all users the info at least the first time. You could then set a cookie to track they have seen the info, but there is no guarantee how long that cookie hangs around.
Good Luck!
You could always just send a confirm alert with JavaScript once you have detected an iOS device such as the second example here (http://www.w3schools.com/js/js_popup.asp) but instead of 'you pressed ok' redirecting to AppStore URL and that will open in the AppStore automatically
Well, you can find out if an app is installed.
If the app listens to a custom url scheme you just try to open a url with it and if the browser is still on the page ofter a set timeout it is not installed. This is you implement links that either open the app or the app store.
And that's tricky since you can't cancel if the app is indeed installed, the link will always open your app.