Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Share to twitter only #899

Closed
wants to merge 2 commits into from
Closed

Share to twitter only #899

wants to merge 2 commits into from

Conversation

Restioson
Copy link
Contributor

Use the social_share package to share directly and specifically to twitter instead of opening a general share dialogue. This PR is currently a draft since I haven't been able to test this on the Android emulator due to unrelated problems with its setup.

Fixes #824.

@da-kami
Copy link
Contributor

da-kami commented Jul 6, 2023

I tested this on my Pixel and this works like a charm!

When I hit the Share on Twitter button in the 10101 app after successfully opening a position Twitter app comes up directly and I have a pre-filled tweet screen:

image


Some notes:

I used the fix in #901 to deploy to my phone with just run-local-android.
I was unable to use the Pay the invoice with 10101 faucet button - but I am not entirely sure why. When I copied the invoice and directly paid it from the faucet on my machine. The payment then worked and I was able to open a position to test the Share on Twitter changes.

@Restioson
Copy link
Contributor Author

I am going to give this a last shot at testing on my emulator, otherwise I suppose this is ready for review and then merge. I would really like to be able to test it locally to certify that it works

@Restioson
Copy link
Contributor Author

I've been digging into this and will report my findings shortly - to expand on what @da-kami said earlier, this is the error when trying to fund using 10101 wallet:
image

@Restioson
Copy link
Contributor Author

This works on my end, too! 🎉 If twitter is not installed, it redirects to the twitter.com page open in the browser. This is good to know, too.

@Restioson Restioson marked this pull request as ready for review July 24, 2023 16:59
@bonomat
Copy link
Contributor

bonomat commented Jul 24, 2023

I've been digging into this and will report my findings shortly - to expand on what @da-kami said earlier, this is the error when trying to fund using 10101 wallet: image

Welcome to the club 😥 I'm getting the same error locally and I can't get it working anymore.

@bonomat
Copy link
Contributor

bonomat commented Jul 24, 2023

This works on my end, too! 🎉 If twitter is not installed, it redirects to the twitter.com page open in the browser. This is good to know, too.

Awesome, if it works. Let's get it in.

Copy link
Contributor

@bonomat bonomat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@klochowicz
Copy link
Contributor

klochowicz commented Jul 25, 2023

I've been digging into this and will report my findings shortly - to expand on what @da-kami said earlier, this is the error when trying to fund using 10101 wallet:
image

are you rebased on top of latest changes? maybe it's time to implement rapid gossip sync 🤔

@Restioson
Copy link
Contributor Author

When running on desktop, I get this when trying to share with Twitter:

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: MissingPluginException(No implementation found for method shareTwitter on channel social_share)
#0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:308:7)
<asynchronous suspension>
#1      SocialShare.shareTwitter (package:social_share/social_share.dart:125:29)
<asynchronous suspension>
#2      TradeScreen.shareTweet (package:get_10101/features/trade/trade_screen.dart:397:5)
<asynchronous suspension>
#3      TradeScreen.createSubmitWidget.<anonymous closure> (package:get_10101/features/trade/trade_screen.dart:386:15)
<asynchronous suspension>

Maybe this is allowable as we are only targeting mobile? A fallback might not be too hard to implement, though...

@Restioson
Copy link
Contributor Author

Added a fallback to just use the old solution if platform isn't IOS or Android (SocialShare only works on those two).

@holzeis
Copy link
Contributor

holzeis commented Jul 27, 2023

@Restioson may I ask you to add a changelog entry for that change? thank you.

Not sure if this is the best approach - maybe copy to clipboard? Either way probably doesn't matter too much. It's just a bit nicer than throwing errors just in case.
Copy link
Contributor

@bonomat bonomat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Let's go

@bonomat
Copy link
Contributor

bonomat commented Jul 27, 2023

@Restioson may I ask you to add a changelog entry for that change? thank you.

I did it for you :)

bors r+

bors bot added a commit that referenced this pull request Jul 27, 2023
899: Share to twitter only r=bonomat a=Restioson

Use the `social_share` package to share directly and specifically to twitter instead of opening a general share dialogue. This PR is currently a draft since I haven't been able to test this on the Android emulator due to unrelated problems with its setup. 

Fixes #824.

Co-authored-by: Restioson <[email protected]>
@bors
Copy link
Contributor

bors bot commented Jul 27, 2023

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@Restioson
Copy link
Contributor Author

@Restioson may I ask you to add a changelog entry for that change? thank you.

I did it for you :)

bors r+

Thanks!

@Restioson Restioson closed this Jul 27, 2023
@Restioson
Copy link
Contributor Author

Closing as this has been merged

@Restioson Restioson deleted the share-to-twitter-only branch July 27, 2023 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Share on Twitter should share to Twitter only
5 participants