Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by cyanogen8872 · Dec 24, 2015 at 09:05 AM · facebookaccount

Cant get public profile of real Facebook account but Test User by Using fackbook sdk & app42

Hello guys, I use fackbook sdk 7.2.1 and app42 for LeaderBoard in my project. alt text

First of all , I use Test User for test the code , it' work,I can get the name, picture....

When I use the real accounts for testing, the GetName() and GetPicture() of app42 cause error.

I can get the access token and useid but I cant get the name and the picture of the real Facebook account and the score is wrong. alt text Same problem in the devices. I dont know how to fix it.

FB login, share function is fine.

I use 3 plueins in my project app42 , facebook sdk , admob. What should I do?

Error Message : com.shephertz.app42.paas.sdk.csharp.App42Exception: System.NullReferenceException: Object reference not set to an instance of an object at ShowLeaderBoard.OnSuccess (System.Object response) [0x00259] in E:....

Sorry for my horrible english.

b.jpg (14.3 kB)
f.jpg (22.2 kB)
Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by cyanogen8872 · Dec 24, 2015 at 04:38 PM

Is this problem caused by AndroidManifest? I combined the admob and facebook AndroidManifest. My AndroidManifest here:

 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.unity3d.player" android:installLocation="preferExternal" android:versionCode="1" android:versionName="1.0">
   <uses-permission android:name="android.permission.INTERNET" />
   <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
   <uses-permission android:name="com.android.vending.BILLING" />
   <supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" />
   <application android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:icon="@drawable/app_icon" android:label="@string/app_name" android:debuggable="true">
     <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
     <!-- Google Mobile Ads Activity -->
     <activity android:name="com.google.android.gms.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
     <!-- InAppPurchase Activity -->
     <activity android:name="com.google.android.gms.ads.purchase.InAppPurchaseActivity" android:theme="@style/Theme.IAPTheme" />
     <activity android:name="com.unity3d.player.UnityPlayerActivity" android:label="@string/app_name">
       <intent-filter>
         <action android:name="android.intent.action.MAIN" />
         <category android:name="android.intent.category.LAUNCHER" />
       </intent-filter>
       <meta-data android:name="unityplayer.UnityActivity" android:value="true" />
     </activity>
     <activity android:name="com.facebook.unity.FBUnityLoginActivity" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
     <activity android:name="com.facebook.unity.FBUnityDialogsActivity" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
     <activity android:name="com.facebook.LoginActivity" android:configChanges="keyboardHidden|orientation" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
     <activity android:name="com.facebook.unity.FBUnityAppLinkActivity" android:exported="true" />
     <activity android:name="com.facebook.unity.FBUnityDeepLinkingActivity" android:exported="true" />
     <activity android:name="com.facebook.unity.FBUnityGameRequestActivity" />
     <activity android:name="com.facebook.unity.FBUnityCreateGameGroupActivity" />
     <activity android:name="com.facebook.unity.FBUnityJoinGameGroupActivity" />
     <activity android:name="com.facebook.unity.AppInviteDialogActivity" />
     <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="fb223700171295186" />
     <provider android:name="com.facebook.FacebookContentProvider" android:authorities="com.facebook.app.FacebookContentProvider223700171295186" android:exported="true" />
     <activity android:name="com.facebook.FacebookActivity" android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation" android:label="@string/app_name" android:theme="@android:style/Theme.Translucent.NoTitleBar" />
   </application>
 </manifest>




Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image phil_me_up · Dec 24, 2015 at 06:07 PM 0
Share

If your test user is working right then it's probably nothing to do with this. See the answer I posted below for the more likely reasons: basically your Facebook app isn't published or you're using an incorrect player ID.

avatar image
0

Answer by phil_me_up · Dec 24, 2015 at 01:58 PM

I've never used App42, so I can't comment on that specifically but if you login to developers.facebook.com and look at your app, is is set to "published"? If it's not then you will only be able to get the details of any "test users" you have set up.

Changing the Facebook app state to "Published" will allow you to get the details of actual logged in users (assuming the rest is setup correctly and you don't need additional approval).

Alternatively you can give the 'real user' a 'developer' or 'test' role within the Facebook app which should let you interact with that user properly before 'publishing' your Facebook app.

If you are already set to published and it's still not working, it might be because you are passing an invalid user ID. It's important to remember that when you connect a real user to an app, the user id you are given is specific to that user, for that app. So, for your app the user id might be 00123423432, but for another app the same user might have the id 00283729198. This is done for privacy reasons.

You therefore need to make sure that the UserID you are using is the one that Facebook returns to you after requesting a login (or at least one you know is valid for this particular appin the case of a friends ID) and not one that you've got from elsewere

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image cyanogen8872 · Dec 24, 2015 at 06:06 PM 0
Share

Thank you for your reply.

About the "Published" option. In other to make my Facebook app state "published" , should I enable this setup only? Any other setting I should do so?

alt text

For the additional approval. I requested to read public_profile, user_friends and email permissions. Is it the problem caused by those permissions?

 var perms = new List (){"email","public_profile","user_friends"}};
         FB.LogInWithReadPermissions (perms, AuthCallback);



For the access token and userID. First, I request user to login. Then take the token and get name and picture.

FB.Init-->FB.LogInWithReadPermissions -->var aToken =
Facebook.Unity.AccessToken.CurrentAccessToken; ShowScoreBoard.userId=aToken.UserId; ShowScoreBoard.fbAcToken=aToken.TokenString;

----> take the userid to Save Score via a app42 function / -----> take the fbAcToken to get the rank , user name ,user picture via app42 funcions

avatar image phil_me_up cyanogen8872 · Dec 24, 2015 at 06:16 PM 0
Share

You'll need to setup the app for the devices you're deploying on too (android I guess from your other comment), so just add that platform and fill in the gaps.

The permissions you are asking for are fine (see here for more info: https://developers.facebook.com/docs/facebook-login/permissions) but do you actually need "email"? Don't ask for it unless you're actually going to use it and the player can see why you want it (I would never allow a game to access my email address without good reason).

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Facebook Login to create User account in my App 0 Answers

how can i upload my game to my blog or facebook? 1 Answer

Too Many heap Sections - on Building to Android 1 Answer

CAN I MAKE a farming game for Facebook ??? 1 Answer

Facbook Authentication token 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges