twitter - Opening the iOS8 share menu without a share button -


i want show share button in unity ios game, , when user taps open sharing menu standard cocoatouch share button. reference i've found far says open share menu add standard share button. don't have option.

i'm hoping there's simple objc call can pass image , have open sharing menu on top of unity game.

that might not possible, given nature of opengl surfaces , cocoatouch. if that's case, i'd know if there's simple way share directly twitter, , documentation that.

it sounds uiactivityviewcontroller class want, i'm not familiar enough how you'd wire unity give complete answer.

you'll need present activity view controller view controller. i'm not sure how unity wraps stuff up, there's chance there's 1 attached main uiwindow (uiwindow has rootviewcontroller property). if can @ things somehow, present there.

for example involve this:

nsarray *itemstoshare = @[@"perhaps high score/brag string here?"];  uiwindow *window = [uiapplication sharedapplication].keywindow;  uiactivityviewcontroller *share = [[uiactivityviewcontroller alloc] initwithactivityitems:itemstoshare applicationactivities:nil];  // warning: these 2 lines require ios 8, govern popup points share.popoverpresentationcontroller.sourcerect = cgrectmake(cgrectgetmidx(window.bounds)-1, cgrectgetmidy(window.bounds)-1, 2, 2); share.popoverpresentationcontroller.sourceview = window;  [window.rootviewcontroller presentviewcontroller:share animated:yes completion:nil]; 

Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -