[IOS/Android] Simple Share to email/Twitter/Facebook etc[V1.9.6]

Max Finch

  • *
  • Posts: 2186
Nevermind, I managed to exclude most of the unnecessary sharing options like print and copy to paste board. :)

Code: [Select]
UIActivityViewController *avc = [[UIActivityViewController alloc] initWithActivityItems:shareItems applicationActivities:nil];
       
        NSArray *excludeActivities = @[UIActivityTypePrint, UIActivityTypeCopyToPasteboard, UIActivityTypeAssignToContact, UIActivityTypeSaveToCameraRoll, UIActivityTypeAddToReadingList, UIActivityTypePostToFlickr, UIActivityTypePostToVimeo, UIActivityTypePostToTencentWeibo, UIActivityTypePostToWeibo];
       
        avc.excludedActivityTypes = excludeActivities;



I kept Air Drop because that actually works well and may be useful maybe?

robinschaafsma

  • *
  • Posts: 712
UPDATE  version 1.1

- Share Screenshot (only on IOS) on android i get only black screenshots.

- Exclude unnecessary sharing options on IOS: (Thanks Max)
  • PostToFlickr
  • PostToVimeo
  • PostToTencentWeibo
  • PostToWeibo]
  • CopyToPasteboard
  • AssignToContact
  • AddToReadingList

« Last Edit: March 02, 2015, 10:37:40 am by robinschaafsma »

rob1221

  • *
  • Posts: 9424
The image API has a block to get the screen as an image.  Have you looked at that?

robinschaafsma

  • *
  • Posts: 712
The image API has a block to get the screen as an image.  Have you looked at that?

No, not yet , i gonna look in to that. Thanks.

riki82

  • Posts: 326
Thanks for the extension!
It's awesome!  :o :D

robinschaafsma

  • *
  • Posts: 712
UPDATE  version 1.2

- Now also share with screenshot on Android

(thanks rob1221 for the heads up, works like a charm with the IMAGE API)

Joraanpe

  • Posts: 288
UPDATE  version 1.2

- Now also share with screenshot on Android

(thanks rob1221 for the heads up, works like a charm with the IMAGE API)

Heya Rob, did you test the new update on android? On my side it gives an error, won't finish compiling:
Code: [Select]
Level:     ERROR
When:      2015-03-02 20:15:44:395
From:      stencyl.sw.util.StreamGobbler

[openfl] /Users/joseanzola/stencylworks/engine-extensions/simpleshare/Share.hx:41: characters 13-37 : Class<com.stencyl.behavior.Script> has no field captureScreenshot


Justin

  • *
  • Posts: 4312
Joraanpe, the extension seems to have been coded for the latest private releases. Make sure you have a recent Stencyl release.

For Live Support: Join our discord server and ping me @justin.
I'm most often available between 8am and midnight Japan time. (GMT+9)

Joraanpe

  • Posts: 288
Joraanpe, the extension seems to have been coded for the latest private releases. Make sure you have a recent Stencyl release.

You are right, it was that.
Thanks Justin

Joraanpe

  • Posts: 288
Extra post: The extension is awesome, works like a charm, thanks rob!

*Id just ask, is there anyway we could "know" if the user shared the message, or if it canceled it? Would be cool to know so we can add rewards after sharing.

*Would there be a way to "force" the user to use certain sharing method, for example twitter/facebook (without allowing them to choose) ?

*Also, dunno if im doing anything wrong but on my tests with android, it does share an image but its an image of a corner of the screen, not the full screen. Any idea why?

Thanks again and keep up the awesome job

« Last Edit: March 02, 2015, 08:28:15 pm by Joraanpe »

robinschaafsma

  • *
  • Posts: 712
Extra post: The extension is awesome, works like a charm, thanks rob!

*Id just ask, is there anyway we could "know" if the user shared the message, or if it canceled it? Would be cool to know so we can add rewards after sharing.

*Would there be a way to "force" the user to use certain sharing method, for example twitter/facebook (without allowing them to choose) ?

*Also, dunno if im doing anything wrong but on my tests with android, it does share an image but its an image of a corner of the screen, not the full screen. Any idea why?

Thanks again and keep up the awesome job

* you can try to make a trigger event, if i program it in the extension it will no longer be a simple share extension.

*this extension use the activityviewcontroller on ios and the the simp;e share intent on Android, this meens IOS or Android looks for al install apps on device how can share a message/website or image. Therefore, it makes this  a simple share extension.  So for this extension not possible.

*thats strange, it works for me. this extension use the build in captureScreenshot of the IMAGE API on Android. Don't no why it works for you...

Joraanpe

  • Posts: 288

* you can try to make a trigger event, if i program it in the extension it will no longer be a simple share extension.



Hi Rob, thanks for your reply.
Could you clarify me a little more the idea?
I mean, how exactly can i know if the operation went successful?
It sounds like id have to deal with the internal code of the extension, am i wrong?

robinschaafsma

  • *
  • Posts: 712

* you can try to make a trigger event, if i program it in the extension it will no longer be a simple share extension.



Hi Rob, thanks for your reply.
Could you clarify me a little more the idea?
I mean, how exactly can i know if the operation went successful?
It sounds like id have to deal with the internal code of the extension, am i wrong?

Hi Joraanpe,

Now that I think about it a little longer, a trigger event wont work, because there is no call back from ios/android code to haxe code. (sending back if true if share succeed).

I think it is a nice idea, if you can reward the player if he share your game. I will look into this.

Max Finch

  • *
  • Posts: 2186
Doesn't the Chartboost extension use call backs for if the ads fail to load or not? Couldn't you do the same thing?

batuhancan

  • Posts: 150
wow, didn't see this one yet, just what I needed. thank you so much!