Tweet not being published - Unity

unity
sdk

#1

Hey,

I just started following the guide to implement a tweet composer in my android game with Twitter’s Unity SDK. Everything works up til the tweet composer which shows up fine except when I hit “Tweet”, it brings me back to the application and the tweet never gets published! I read about this being an whitelisting issue, however I’m not using the user’s email address so I don’t see the need to be whitelisted.

Any help on the matter is appreciated.

Thanks.

Twitter Kit 3.20 (August 10th)
Unity 5.6.2f1


#2

Is this from iOS or Android? If you build as debug mode to either platform you should be able to see the logs.
Can you paste the relevant logging?
In your app’s Permissions page make sure ‘Request email addresses from users’ is checked if you need that.
Also have you tried running the TwitterDemo scene? I would start with that first and make sure login and compose tweet work.


#3

My apologies, I meant to write that my app isn’t using the user’s email address. It’s an Android app built through Unity. After examining the adb logcat output, I found the following which happens as soon as I click “Tweet” in the composer.

08-25 01:40:01.958 10056 10075 I Unity   : Tweet failed
08-25 01:40:01.958 10056 10075 I Unity   : UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
08-25 01:40:01.958 10056 10075 I Unity   : UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
08-25 01:40:01.958 10056 10075 I Unity   : UnityEngine.Logger:Log(LogType, Object)
08-25 01:40:01.958 10056 10075 I Unity   : UnityEngine.Debug:Log(Object)
08-25 01:40:01.958 10056 10075 I Unity   : TwitterKit.Internal.TwitterComponent:TweetFailed(String) (at D:\Unity\Unity Development\Crab Crunch\Crab Crunch Main\Crab Crunch\Assets\Twitter\Scripts\TwitterComponent.cs:90)
08-25 01:40:01.958 10056 10075 I Unity   :
08-25 01:40:01.958 10056 10075 I Unity   : (Filename: D Line: 0)
08-25 01:40:01.958 10056 10075 I Unity   :
08-25 01:40:01.961 10056 10075 I Unity   : NullReferenceException: Object reference not set to an instance of an object
08-25 01:40:01.961 10056 10075 I Unity   :   at MenuController.<StartComposer>m__1 (TwitterKit.Unity.ApiError error) [0x00007] in D:\Unity\Unity Development\Crab Crunch\Crab Crunch Main\Crab Crunch\Assets\Scripts\MenuController.cs:235
08-25 01:40:01.961 10056 10075 I Unity   :   at TwitterKit.Internal.TwitterComponent.TweetFailed (System.String error) [0x00023] in D:\Unity\Unity Development\Crab Crunch\Crab Crunch Main\Crab Crunch\Assets\Twitter\Scripts\TwitterComponent.cs:92
08-25 01:40:01.961 10056 10075 I Unity   :
08-25 01:40:01.961 10056 10075 I Unity   : (Filename: D Line: 0)
08-25 01:40:01.961 10056 10075 I Unity   :

#4

Have you tried running the TwitterDemo scene included in the package? Try to compose a tweet from there. Make sure to modify it so it calls the compose after login instead of request email.


#5

I just tried the Twitter Demo after adjusting the demo script to call the compose after login. Exact same issue. The tweet composes perfectly fine with the screenshot and text. As soon as I click Tweet, the composer closes and I get returned to the app but no tweet is ever posted.


#6

Sounds like something is wrong with your app auth or login. You can try revoking access to the app on the account you are logging in with: twitter.com -> settings and privacy -> apps -> revoke access.
If that doesn’t work try creating a new test app at apps.twitter.com and test with it’s api key and secret. Because at the very least you should be able to post using the demo.


#7

I tried revoking access - no luck. Does this have anything to do with OAuth. I followed the Twitter Kit for Unity guide and it didn’t mention OAuth.


#8

Hi,

I’m having exactly the same issue. I’ve followed the steps above as well and still no joy. I’m using TwitterKit 3.21 and Unity 2017.1.1p3 on Android 8.0. We tried the remedial steps you mentioned on Aug 26th.

In TwitterComponent.TweetFailed, error is coming back as null (or an empty string), which then results in a null ApiError being returned to my callback, so I don’t have much to go on in terms of what has gone wrong.

Can you shed any more light on this?

Thanks,

Owen


#9

Were you able to post a tweet with the demo app?


#10

Hi,

I figured out what the issue was, there was a problem with the image uri (although it displayed correctly in the compose view). Would it be possible to add a bit more information as to why a tweet failed into the callback?

Thanks,

Owen