twitter,unity3d,ios8 , Opening the iOS8 share menu without a share button


Opening the iOS8 share menu without a share button

Question:

Tag: twitter,unity3d,ios8

I want to show a share button in my unity iOS game, and when the user taps it open the sharing menu that you get from the standard cocoatouch share button. The only reference I've found so far says that to open the share menu you add a standard share button. Obviously I don't have that option.

I'm hoping there's some simple ObjC call where I can pass it an image and have it open the sharing menu on top of my unity game.

That might not be even possible, given the nature of opengl surfaces and cocoatouch. If that's the case, I'd like to know if there's any simple way to share directly to twitter, and where the documentation is for that.


Answer:

It sounds like UIActivityViewController is the class you want, however I'm not familiar enough with how you'd wire this into Unity to give a complete answer.

You'll need to present the activity view controller from another view controller. I'm not sure how Unity wraps this stuff up, but there's a chance there's one attached to the main UIWindow (UIWindow has a rootViewController property). If you can get at those things somehow, you could probably present it from there.

For example it would probably involve something like this:

NSArray *itemsToShare = @[@"Perhaps a high score/brag string here?"];

UIWindow *window = [UIApplication sharedApplication].keyWindow;

UIActivityViewController *share = [[UIActivityViewController alloc] initWithActivityItems:itemsToShare applicationActivities:nil];

// warning: these two lines would require iOS 8, but they only govern where the 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];

Related:


Unity procedural TileMap generation without creating gameobject per tile


unity3d
I've been searching all over the internet to find a efficient way to create procedural tilemap without creating a gameobject per each tile. There is none, or simply i couldn't find it, because i really don't know how to make a search for it. All the TileMap tutorials i found...

Convert a large int to a float between 0.0f and 1.0f


math,unity3d,numbers
I'm working on a project where I have a pane that goes from 0 to 500 on the x and z, but I need to convert that coordinate (from 0 to 500) to a float in the range of 0.0 to 1.0 in because it is required from some of...

how to add Scoring to unity3D 2d top down car game?


unity3d,2d,car,topdown
I'm making 2D top down car game. as for now car game working with if player car hit enemy car game is over. I used for it adding tag to Enemy car and if player car collision detect enemy car with tag the finish the game. My question is: How...

Unity An object reference is required to access non-static member C#


c#,unity3d
Im trying to learn C# with Unity engine But a basic script like this: using UnityEngine; using System.Collections; public class scriptBall : MonoBehaviour { // Use this for initialization void Start () { Rigidbody.AddForce(0,1000f,0); } // Update is called once per frame void Update () { } } gives this...

Android - Unity3D freeze in splash screen on some phones


android,unity3d,screen,freeze,splash
I have a problem with Unity3D. I created a game with Unity 4.6.2f1. My problem is, game crashes after splash screen(Like trying to open itself constantly). The weird part is, game works on my phones and my tablets perfectly. I have Nexus 5(With Android 5.1.1) , Iocean X7S(With Android 4.2.2)...

Unity3D Bullet Tracers


unity3d,unityscript,raycasting
I'm currently working on implementing the elusive bullet tracer to my FPS. It isn't going so well. a. The tracers align themselves off of the barrel of the Raycast area b. They all aim themselves in the same direction, no matter where I point my cursor This is the formula...

Twitter: Get followers from multiple users at once


r,twitter
I am working on a project where I need to find the reach of some social events. I want to know how many people who were exposed to comments on a festival called Tinderbox in Denmark. What I do is to get the statusses on Twitter including the word "tinderbox"...

Inserting tweets into MySQL DB using Tweepy


python,mysql,twitter
I am trying to use the following Python code to insert parsed out tweets into a MySQL database: #-*- coding: utf-8 -*- __author__ = 'sagars' import pymysql import tweepy import time import json from tweepy import Stream from tweepy import OAuthHandler from tweepy.streaming import StreamListener class listener(StreamListener): def on_data(self, data):...

Twitter4j Stream to get own profile tweets


android,twitter,twitter4j
I am trying to use the twitter4j api to retrieve my own tweets only (ie, every 3 sec). After using the manual "ResponseList statuses = twitter.getHomeTimeline();" , i encountered a problem which the request rate was capped. The solution i can find is to use stream service. Right now, my...

Unity3D Play sound from particle


audio,unity3d,collision,particles
I am trying to play a sound when a particle collides with a wall. Right now, it just plays the sound from the parent object, which is the player. However, I want the sound to play from the particle. Which means when a particle is far to the left, you...

How To Properly Encode Tweets in Html (with c# hopefully)


c#,angularjs,twitter
I'm programmatically building up a tweet that end in #angularu which of course blocks the html from that point on. What is the proper way to encode a tweet so that it works and gives the full message in html <a ng-href="http://twitter.com/home?status=Dan and John Bringing Their https://angularu.com/ng/session/2015sf/dan-and-john-bringing-their-view-on-the-latest-in-angular Mon 11:00 AM...

What is this programming method called? And is it bad?


c#,unity3d,modular
Lately in my Unity projects, I have discovered that to create a more modular application it helps to have a static List in a class that contains references to all or some of the objects created so that they may be accessed easily from other parts of the program. An...

How to Create Thumbnails in unity


unity3d
I am creating a video player app for android. for that i need to create thumbnails for the videos present in the videos folder. After searching web i could able to understand unity's MovieTexture doesn't support for android. This one i could able to solve using a plugin. For creating...

Formatting large numbers in C#


c#,.net,unity3d,formatting
I am using Unity to make an "Incremental Game" also known as an "Idle Game" and I am trying to format large numbers. For example, when gold gets to say 1000 or more, it will display as Gold: 1k instead of Gold: 1000. using UnityEngine; using System.Collections; public class Click...

How do I customize and use Phirehose functions?


php,twitter,oauth,stream,phirehose
I'm trying to put in a check for Phirehose to stop running after 10 seconds or 100 tweets...basically, I want to be able to stop the script. I was told I could customize the statusUpdate() function or the heartBeat() function, but I'm uncertain how to do that. Right now, I'm...

2D game development with Unity3D


unity3d,2d-games
I tried to find some answers to a few questions I have about Unity3D games development. I want to create 2D mobile games. The thing I really want to know is if I can create a mobile game for different platforms at one time (as cordova can build Android /...

Loading MP3 files at runtime in unity


c#,unity3d
I'm trying to load an mp3 file at runtime using the WWW class that is provided in Unity. I don't get any errors, but I'm unable to play the music after the song has been processed. I have looked everywhere and cannot find anything to help me. Here is the...

AdColony's OnVideoFinished not call in Android


c#,android,unity3d,adcolony
I have a problem with AdColony-UnitySDK. When AdColony's video is finish playing, OnVideoFinished() method don't be called. In this case, the following sources work well in iOS. And also, the server receive the success callback both device. So, only Android device that is not work. Here is the source code,...

Java code to fetch the twitter followers of any user using twitter screen name


java,twitter,twitter4j
I tried to get the twitter followers using the screen name. But i am able to get only my followers screen names where as i am expecting the followers of my followers. But i didn't found any supported method for this. My code is as follows. TwitterFactory factory = new...

Our iOS developer has developed a game in Unity3D. How do we export it for Android?


unity3d
Our iOS developer has developed a game in Unity3D. How do we export it for Android? I did a quick check on the internet and it says there "one click export for Android". Is this really the case? Are there ways it might have been developed that will make it...

How to make the whole scene in dark on unity3D


unity3d
Likes that when the game is pause, only the Resume button is lighted, other whole scene is in dark, Is there some function can do it?

How do I Mute The Audio In Unity 3D?


c#,audio,unity3d,mute
with script this. what is wrong in script this ? audio.mute = ToggleButton.isSpeakerOff; sorry bad english,fast answer please correct my script please...

When adding dependency: CDI deployment failure, Unsatisfied dependencies for type Set with qualifiers @Default


maven,twitter,glassfish,twitter4j,twitter-hbc
When I add the twitter hbc dependency to my pom.xml I'm getting an error. I followed the instructions from here. I don't get it, if it was a dependency problem I should have found a fix on the web but if I comment out that dependency, my server is starting.....

SWF works locally but not loaded from server


mod-rewrite,unity3d,swf,swfobject
Here is the deal. I have SWF build with Unity and embedded into HTML page with swfobject. It works perfectly well when I load page locally (zip), but it always says "Movie not loaded" when I try to load page. from server I have already inspect similar embedded movies (this...

Unity WaitForSeconds stuck


c#,unity3d
I tried to create a simple splashscreen. at first this waitforseconds working, but suddenly after a few week this code doesn't want to work. I tried using debug.log but I just get the "before wait" and the "after wait" doesn't appear even after 5 minutes. I am using unity 4.5,...

Unity: GameObject.FindGameObjectWithTag isn't working and I don't know why


unity3d
I have a enemy AI script and a small part of the code isn't working. It's supposed to search for a game object with the Player tag when the target no longer exists. So, when the player collects a power up and a new player prefab spawns in its place...

How to match words in 2 list against another string of words without sub-string matching in Python?


python,regex,string,loops,twitter
I have 2 lists with keywords in them: slangNames = [Vikes, Demmies, D, MS Contin] riskNames = [enough, pop, final, stress, trade] i also have a dictionary called overallDict, that contains tweets. The key value pairs are {ID: Tweet text) For eg: {1:"Vikes is not enough for me", 2:"Demmies is...

Unity: Prefab parenting in code


unity3d,gameobject
Let's say I want multiple prefab object called childTile, it parenting another single prefab object called parentTile. So whenever the parentTile rotates, childTiles will be rotated around parentTile. Basically this is what I wrote: public GameObject childPrefab; public GameObject parentPrefab; void Update() { for(int i = 0; i < 10;...

Action after tweet has been published


ios,twitter,sprite-kit
I set a button in my game where you can tweet your score. The thing is that when the user just publishes the tweet I want to open a new view and I don't know how to know when the tweet has been published. For publish the tweet I used...

Twitter Typehead, listing object arrays


javascript,jquery,arrays,twitter
I am having a problem using the Twitter Typehead with an object array. please view the JSBin here http://jsbin.com/buyudaq/edit?html,js,console,output Following is the serialised object array var phoneNumbers = { "data": [ { "phone": "+1 (923) 562-3211" }, { "phone": "+1 (924) 431-3216" }, { "phone": "+1 (932) 411-2223" }, {...

Stack level too deep because recursion


ruby-on-rails,ruby,ruby-on-rails-4,twitter
I have a model named Tweet. The columns of the Tweet model are: -id -content -user_id -picture -group -original_tweet_id Every tweet can have one or multiple retweets. The relation happens with the help of original_tweet_id. All the tweets have original_tweet_id nil , whilst the retweets contain the id of the...

Create array/list of many objects(initially unknown amount) by tag


c#,arrays,list,unity3d,gameobject
I'm currently working on a radar system for my space game, and I am trying to work out how to add gameobjects, by tag, to either a list or array that can then be used in other methods. I can't do this manually because I will be procedurally generating each...

Manual slide-in animation using delta time


c#,animation,unity3d
I'm creating a simple slide-in animation for my game. The box is shown at the bottom with character dialog. The animation is supposed to look as follows: A square slides in from the left, then waits a bit, then expands to its full width. The box is made using Unity's...

EditorGUILayout.Popup option is not changing


unity3d,unity3d-gui,unity3d-editor
using this simple code I'm showing a dropdown int selected = 0; ///* string[] options = new string[] { "Start With", "End With", "Contains", }; //criteria = EditorGUILayout.Popup("Search Criteria", 2, options); //*/ criteria = EditorGUILayout.Popup("Awesome Drop down:", selected, options, EditorStyles.popup); it showing dropdown with option perfectly but the problem is...

twitter4j geo streaming latitude/longitude for Hongkong


java,twitter,latitude-longitude,twitter4j
I'm trying to capture tweets using twitter4j's streaming methods from the area of Hongkong. However not matter what latitude or longitude coordinates I choose to do so (from http://www.latlong.net/convert-address-to-lat-long.html) I always get invalid latitude/longitude error. Latitude/longitude are not valid: 22.27, 114.17, 22.35, 114.21 The code I use is otherwise working...

I'm trying to reduce the Length of this Code


c#,unity3d
I wrote some code today. I can't figure out how to reduce the length of this code, although it seems repetitive, every part is different. try { totalVerts.Add(verts[i]); if (verts[i].x > maxXvert) { maxXvert = verts[i].x; } if (verts[i].x < minXvert) { minXvert = verts[i].x; } if (verts[i].y > maxYvert)...

Turning an avatar into a 3rd person character


animation,unity3d
I just learned how easy it is to simply drag a 3rd person character controller prefab (from Unity's standard assets package) and drop it into the hierarchy. Using the WSAD and Space keys feels pretty natural, so I wondered if I could apply the same character controller to a customized...

Is it possible to use the Twitter API to feed tweets into a local text file? [closed]


javascript,twitter
I am using a projection mapping programme, with part of the project taking text from a local text file, and inserting it into the programme. Instead of manually filling this text file with pre-populated content, is it possible to use the Twitter API to feed in tweets to this local...

How to draw each a vertex of a mesh as a circle


ios,unity3d,shader,mesh,particle
How to draw each a vertex of a mesh as a circle?

How expensive is creating class instance? (performance considerations) [closed]


c#,unity3d
In C#, how expensive it is to create new class instance? I'm speaking in context of using C# in unity3d. Meaning that stuff continuously gets called many times per second. In C++, generally speaking (while making games) you may want to reuse anything you created with new/smart pointers, you would...

In Unity3D, How to make the whole scene in dark, but some Area are not in dark


unity3d
I wan't make some teaching levels with UGUI, so need the whole to be in dark, but some rectangular area not in dark. I can make the whole scene in dark by adding a gameobject with a image component, and control it's alpha to dark. But I don't know how...

Unity 3D Text becomes Word Cubes


android,unity3d,vuforia
As the image shows, my 3D Text keeps disappearing from my scene when I click Play, and then when I zoom in, this is what I see. When I exit the Play scene, it stays like that till I Ctrl+S and Save on which is returns to its proper text...

Python encoding issue when trying to parse JSON tweets


python,json,twitter
I am trying to parse out the tweet and username sections of the JSON object returned from Twitter using the following code: class listener(StreamListener): def on_data(self, data): all_data = json.loads(data) tweet = all_data["text"] username = all_data["user"]["screen_name"] c.execute("INSERT INTO tweets (tweet_time, username, tweet) VALUES (%s,%s,%s)" , (time.time(), username, tweet)) print (username,...

Converting from Pixel Coordinates to UI Coordinates in Unity


user-interface,unity3d
Does anyone know how to convert from Pixel Coordinates to UI Coordinates and vice-versa in Unity? Let's say for example I want to click somewhere on the screen with the mouse, and a UI Image to be at that click position. If I do this won't work: Image img =...

Csproj file in unity changes everytime i reload the project


c#,unity3d,msbuildcommunitytasks
I want to change the 'csproj' file of my unity project in order to be able to access a specific library as this answer sugests. I am manually editing the file but every time i reload the project, the 'csproj' file returns to it's initial state. Is this a common...

Error installing gem twitter on Ubuntu 15.04


ruby-on-rails,ruby,ubuntu,twitter
Am trying to install twitter gem on Ubuntu 15.04 and this error keeps popping up gem install twitter Building native extensions. This could take a while... ERROR: Error installing twitter: ERROR: Failed to build gem native extension. /usr/bin/ruby2.1 extconf.rb mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h extconf failed,...

Using Twitter Fabric to retrieve my own account tweets


android,twitter,twitter-fabric
I'm currently using twitter fabric framework and trying to retrieve the list of my own account tweets. I tried searching online to no avail. The example in the document shows how to display a tweet based on tweetID. I do not want that. I do understand that REST client makes...

How to make the Twitter API returns me over 800 tweets


api,twitter,timeline,tweets,home
How to make the Twitter API (home_timeline) returns me over 800 tweets? For example applications like tweetbot how do it to have more updates in the 3000 home timeline? I think that using a cache system but which one?

Unity 5 Audio Volume Slider (Solved)


c#,audio,unity3d
I am trying to create an slider that I can use for volume control in Unity 5 but the volume will not change. My Game Objects are called MainMusicPlayer for the audio source and Volume Slider for the slider I am going to post the whole script as it would...

var keyword vs actual type? [duplicate]


c#,unity3d
This question already has an answer here: Use of var keyword in C# 86 answers I'm using vim + omnisharp/syntastic for some unity3d development in C#. When I declare a variable using the actual type, for instance string[] myArray = new string[5]; I get a warning message telling me...