How to share text or image from ios app to Yammer - ios

I need to share the text or image from one ios app to Yammer social network.
I am able to do login using iOS SDK of Yammer but not getting how can I share text or image from ios app to Yammer. I got the code to share text from browser but not from application.
Anybody has any idea??
Thanks in advance for your help and efforts.

This is documented on the Yammer API page. In order to post text and attach image
https://developer.yammer.com/v1.0/docs/messages-json-post
Parameters:
body - The text of the message body.
attachmentn and pending_attachmentn - Yammer provides two methods to associate attachments with a message. Both make use of multi-part HTTP upload (see RFC1867).
The first method is the easiest, simply use file form elements with names attachment1 through attachment20. If there are a several attachments or the attachments are large it may take some time for a message to POST causing your application to appear to hang.
An alternative way is to use the Pending Attachments resource (see below for details) allowing attachments to be uploaded in parallel. Apps that support HTTP chunked transfer encoding can monitor the progress of each upload. On success each pending attachment’s response body includes an id. These pending attachment ids are to be submitted with the message using form elements pending_attachment1 through pending_attachment20. Finally, if form elements for both attachmentN and pending_attachmentN are present only the pending_attachmentN elements will be honored.

I never used Yammer, but I wrote another app like Yammer used the given API, Yamme site should provide an API to share.

Related

Sending email with attachments through iOS Outlook

My application (a DMS client) has strong ties to Microsoft technology, so my customers are on average much more likely to run Outlook for iOS than the default iOS Mail client.
However, Outlook does not respond to the MFMailComposeViewController, so that basically leaves two approaches on the table for sending email from the app:
Use the msoutlook:// URL scheme to open Outlook. This supports pre-populating recipients, subject, and a HTML styled body text, apparently without a maximum length. However, it does not seem to support attachments.
Use the UIActivityViewController (i.e. the "sharing" interface), which does allow for attachments (hurray!), but I don't know if it's possible to pre-populate any of the fields other than the content...and the sharing dialog itself is really unpleasant UI, interrupting the user flow with a complex choice.
Word (for iOS) presents the user with the following flow that directly opens a document as an attachment to a new email in Outlook. Assuming they don't use any private APIs, how are they doing that?

Remove need to press "Tap to Load Preview" for iPhone OpenGraph SMS Message

I am trying to be able to send SMS messages with links that contain OpenGraph preview images which will load in the iOS "Messages" application and will display the thumbnail without the user having to press [Tap To Load Preview] first... How can this be achieved?
For this, I am sending a text SMS message to an iPhone X which is running iOS 10 and opened with the Messages app.
The text message body contains a URL that points to a resource (a HTML web page) whose body contains OpenGraph metadata with an og:image tag. Eg:
<meta property="og:image" content="https://www.apple.com/v/iphone/home/t/images/home/og.png?201610171354" />
For presentation purposes, we are trying to make it so that the image will load first and immediately, without the user having to tap the button in order to to see it...
Expected Behavior:
Actual Behavior:
As a side note, on the Android clients we have tested, where OpenGraph is supported the image will display instantly without the user being prompted to do anything. The same is true for any other OpenGraph supported application tested, including Facebook.
For reference, here are some of the methods I've tested to try to get this working for us (as well as combinations therein):
Tried serving the image directly with no intermediate redirects, also tried with redirects.
Tried serving PNG and JPG images.
Tried serving the images from URL's containing no more than 20 characters where the URL has the ".jpg" and ".png" parameters and no additional GET parameters. Also tried when the extensions aren't part of the link.
Tried serving the image from the server by referencing its IP directly instead of using a public domain name.
Tried with GET parameters as well, with random numbers to clarify a totally unique URL each time.
Tried serving the image from HTTPS and HTTP links.
Tried serving with dynamically generated images, which should entail a brief delay of some milliseconds while the image is rendered and served.
Tried an enforced sleep in the script that responds to the URL page as well as for the image request to induce an intentional delay of some milliseconds and experimented with various settings for that.
Tried serving the image with a variety of different dimensions, portrait and landscape as well as extremely large and extremely small and other variants between (50x50, 60x50, etc and up).
Always ensured that the image is <1 MB in size, but also tested larger images anyway to see if they would work.
Tried serving images from the same canonical source that the phone or Message service might already 'recognise' as 'trusted' as we have already loaded the preview from those those in the past (testing if such a feature exists, which it probably doesn't).
Tried specifically, all suggestions as noted Apple Technical Note "Best Practices for Link Previews in Messages" see https://developer.apple.com/library/content/technotes/tn2444/_index.html
Tried moving the OG tags outside of the <head> of the page.
Tried stripping of the page of all tags except for pertinent og:image tags.
Tried removing HTTP headers for the response to the GET to the image resource so that just the image itself is returned. Tried then adding back the Content-Type header alone.
Tried priming the request to the image to respond with various HTTP specification cache-invalidating related headers..
Tried sending from various phone numbers US and Australian, also tried changing the "From" field for the SMS message itself to strings like "VERIZON", "Verizon", "Telstra", "APPLE", "Apple", "Facebook", "Uber", "China".
Tried sending the messages from handheld phone as well as from the Twilio Messaging API service.
None of the above work for an iPhone X.
There is no way to do this with SMS. If you send it as an iMessage it will automatically display the preview.
On iPhones the preview is generated on the device rather than server-side. When a user taps preview their device sends 4 GET requests to the server. If the preview was generated automatically there would be a security vulnerability. You could send a text to any iPhone user and get their IP Address.
With iMessages the preview is generated automatically but there is no security vulnerability. The device sending the link sends 4 GET requests to the server, generates the preview and then transmits the preview to the recipient via iMessages. As a result, the receiving device has no need to send a request to the server to generate a preview. And their IP Address is not known to the owner of a webserver.
On Google's Android Messaging app the preview is generated server side. There is one GET request sent to the web server. But it originates from the Android Messages server. So again the owner of the webserver does not receive the recipient's IP Address from their receipt of the text.

Manipulate PDF iOS (add signature)

I'm trying to find the best solution for my problem. User is using safari on an iPad, and at one point the customer contract is created using a webservice, which sends me the URL to a PDF file.
Right now the user opens the PDF, prints it and scans it after the customer signs the contract. What they want is to capture the signature digitally, so the contract doesn't need to be scanned later.
My question is: what is the best way to embed the signature to an existing pdf file?
I wanted something similar to what the iOS mail app does natively
http://heresthethingblog.com/2015/10/28/ios-9-tip-sign-pdf-mail-pdf-tricks/
Thanks

Facebook iOS SDK Pass parameter with app requests

I would like to have my native iOS app send a request with a parameter to a Facebook user on iOS. If they accept, it will launch my native iOS app and pass it the parameter. Is this possible?
I am having marginal success using [facebook dialog:#"apprequests" andParams:dict andDelegate:self]. I am getting the bookmark counter to increment on Facebook iOS app, but I do not see the individual requests. If I tap the bookmark it launches my app but I do not see how I can get the "data" parameter I passed with the request, or even the request_id.
On desktop I see the individual messages under "Requests" section of "Apps and Games". If I accept a request, I can see it pass the request_id to my (simple echo) canvas URL. I read this can be used to fetch the associated data. But, this does not help me on iOS. My app only runs on iOS, so this canvas app will eventually just be a "this app only works on iOS," but it seemed to be necessary to get the requests to flow.
Neither of these are showing me Notifications, so maybe I am doing something basic wrong. Or, is there some other way to pass a message to a Facebook user, with a URL they could click (to launch and feed my app its parameter).
One other odd thing, I do not see how to get rid of the Requests. If I "X" them on the desktop client, it asks me if I want to stop receiving all requests from my app, and if I say no, it only hides them temporarily.
Leif, Hi - I'm the engineer at Facebook who wrote the tutorial you've referenced.
I've taken a look at the issue you've mentioned - this is in fact not a bug in the documentation and is by design.
The incoming url from a request on iOS looks something like this:
fb480369938658210://authorize?expires_in=3600&access_token=BAAG05NeN86IBAC31YWMWRHVrNCAYMy0Rv1OtqZCwdH8QDBUAt5KgZCsIbU0EOZAvMms2tZCANV9sZBWSkEzStDtt4i7YnYZA4bPgGx2XaI5s22iBMxIZAneZAv7ADi3Wi20ZD&target_url=http%3A%2F%2Fm.facebook.com%2Fapps%2Ffriendsmashsample%3Ffb_source%3Dnotification%26request_ids%3D364209433669109%252C379616028785376%252C494409170593789%252C489782271042929%252C328564930575784%26ref%3Dnotif%26app_request_type%3Duser_to_user
This is bundling together several requests, with multiple request ids into a single url.
To get the extra data coupled with this request, it is not required to have the user_id. Hitting graph.facebook.com/*request_id* is enough.
You can actually see this outlined in the documentation here: https://developers.facebook.com/docs/requests/#deleting under the 'Request ID Format' heading.
The code contained in the Friendsmash sample and on the tutorial works correctly - I verified it just now. So it should serve as a good guide to the OP's question.
Thanks!
I have been struggling with this too.
First, the FB iOS SDK requests tutorial is a good start.
However, there are also a few bugs that makes things not work as expected:
It seems that currently, a mobile web url has to be set up for the FB app in order for requestIds to be forwarded from the native FB app to your native app. See this bug report.
The tutorial mentioned above uses an erroneous graph path for the request object. I uses "request-id" where it should be "request-id"_"user-id". I have filed a documentation bug report on that issue.

Upload images to Salesforce through iOS App

I am trying to upload image to Salesforce just like updating Leads or Accounts through my Phonegap iOS app. I can get the image but by googling a bit, I got to know that i have to convert the image into a BLOB.
My query is about two things:
1. How to convert the image into a blob?
2. How to upload that blob to Salesforce?
Thanks in advance
A blob is just a Binary Large OBject, i.e. a lump of binary data. You just want to read the file into memory and use it's content directly. There may be a need to base64 encode it, but I wouldn't have thought so.
There's a Phonegap plugin for downloading binary data on iOS here, you can see how it uses the standard Apple SDK calls for file access, so opening them shouldn't be a problem for you.
The blog would be a field on an object, much like fields on your Accounts and Contacts, I'm not sure how you specify the size, but putting the binary data into the field shouldn't be a problem.
There's an example of using the REST API to upload binary data (to a document) here — I imagine your solution would be similar to this. What Salesforce API are you using for your app? Are you using their Mobile SDK?
You can attach images to Salesforce record on iPhone using Salesforce Mobile app. This requires a little customization - VF page and apex class. Once you have created the VF page for attachment, then you need add this VF page as 'Visualforce Tab' and enable it on Salesforce Mobile Configuration. Steps to add the newly created Visualforce Tab onto Salesforce Mobile Configuration : Setup->Mobile Administration->Salesforce Mobile->Configuration->'Select your Configuration'->Mobile Tab.
Now using this tab on Salesforce app, you can upload images as attachment.

Resources