How to get progress of sending image via bluetooth (Gamekit)? - iphone

I implement an application on iPhone which sharing photo via bluetooth(Gamekit).
I want to khow how to get a percentage of photo sending.
Please tell me.
Thanks

To keep under the maximum transferred data size you have to support breaking up your data.
Break up your data in, say, 10 fragments. Send each fragment in turn. Add up the percentages as each fragment is sent and recieved.
Alternatively have the recipient post back unreliably how much data has been received.

Related

How do I forward a mail message as an attachment in MS Graph?

I'm retrieving all the messages from a given mailbox, and if one of them contains problematic attachments, I want to send an email to the sender of that message, explaining the problem, and including the original email as an attachment.
I need to either put the message into a stream, or save it to the filesystem. I imagine the former would be better, but I can't see any methods that can do that.
How big are the attachments that you want to forward? With the Graph there is a 4MB limit that you will hit with some of the endpoints that will restrict the methods you can use to do this. Eg if all the Messages are under 4MB then you could either attachment them as an Item attachment https://learn.microsoft.com/en-us/graph/api/message-post-attachments?view=graph-rest-1.0&tabs=http but for your purposes you'll loose fidelity on things like Internet Message headers which won't help with working out what's gone wrong with the message. Probably what you want to do is download the message first as MIME https://learn.microsoft.com/en-us/graph/outlook-get-mime-message save it as an Eml file and then attach that file. If you need to deal with 4MB+ emails you need to check the size and use https://learn.microsoft.com/en-us/graph/outlook-large-attachments?tabs=http when necessary.

Detecting image load on server

I am wondering how services like mailchimp detect email opens
I read it's because they add a 1x1 pixel image
Can someone tell me how this is done on my server ? I am using AWS :)
I would also like to know how these services detect things like device and browser/email client
I read it's because they add a 1x1 pixel image
True
Can someone tell me how this is done on my server ? I am using AWS :)
The usual approach is to set the image source attribute to a URL on your web server that includes a query string parameter that you can track back to a particular user, for example a hash of the user's email address or their ID in your system, e.g. in the email you send you add a tag like this
<img src="http://example.com/track?id=42 width="1" height="1" />
That forces the email client to load the URL http://example.com/track, which would return a 1x1 transparent image and also log that the ID 42 requested that image.
Note that some email clients block images from some domains. If the user has you in their contacts list, chances are pretty good the image will be shown. Some ISPs will consider your sending reputation, your implementation of email security standards (e.g. SPF/DMARC) and other factors in deciding whether to actually request and display the pixel data.

Google analytics email open tracking with measurement protocol

we tried to track email opens with google analytics and measurement protocol. We exactly followed instructions given in http://www.lunametrics.com/blog/2013/06/17/email-tracking-google-analytics/ and http://dyn.com/blog/tracking-email-opens-via-google-analytics/
The problem is that every email open is counted also as a session which is not correct. Can you give me any advice how we can track opens without recording sessions? Thank you
Every hit in GA always starts a session, so this is not possible. If you don't want it to appear in your normal profile, try setting a pageview with prefix so you can filter them out into a seperate View.
e.g.
/virtual/email-open
Then set up your filters.
Session begins with any interaction. Don't be sad, it is correct.
You can extend your data with some identifier like virtualpagname or whatever and than make segment or filter.
dp=mypage.com
dh=/emailing
dt=Email Gate
You can either use datasource parameter:
ds=email
https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#dataSource

Continue uploading NSData even connection lost/user clicked on home NSUrlConnection

I need to upload via HTTP Post NSData which is UIImage or NSUrl of a video file via the iPhone app which I develop for ios6
I need to support the following cases:
The user clicked on home - to continue uploading in background
The connection is lost - to continue uploading when there is a new internet connection even if the user left the app by clicking on the home button)
The user quit the app (clicked on x) and it was in the middle of uploading, next time that he would open the app, it will continue
In case 2 and 3:
It will continue from the same location that it was in the NSData (not start from the beginning of the file)
It will send in the new call a variable index={index} (where index is the amount of times that it continues starting from 0
I know how to use NSURLConnection as an async connection. But how to support the above 3 cases?
For this to work you need 2 things:
A record, stored persistently, of how much data has been uploaded to the server.
A server which accepts the Content-Range header and can handle storing partial uploads and completing them later. (or a server with an API to handle the same function).
If you have both of these things then you can perform the task using NSURLConnection and its delegate methods, NSUserDefaults (or similar) to store the progress information and subdataWithRange: (or perhaps NSFileHandle) to get only the data which needs to be uploaded.
Look at using connection:didSendBodyData:totalBytesWritten:totalBytesExpectedToWrite: to get updates of what data has been sent. Store that number (if not all of the data has been sent) into user defaults. Once all the data has been sent, remove the number from user defaults.
Use subdataWithRange: by creating a range from the stored number to the (total length of data - the number).

Google Drive Sdk- Audio & Video Streaming in iOS Application

Hi Google Drive Staff,
I have tried to stream video files from Google Drive(Without Downloading). But I gets alerts that Sign In. I have went thoroughly with Dr. Edit sample App but i did not found any solution. I tried with downloadUrl , embedLink, webContentLink, alternateLink. All gives message to sign In. When i tried with exportsLinks i get a Null Message. What is the problem Here. If U have any suggestion Please Let me Know...
I have tried with Google Drive for iOS in iPod, there we can stream Video without Downloading.
Please suggest me to resolve this issue
Thanks in Advance...
I could solve it just by appending the access_token to the download url
audiofile.strPath=[NSString stringWithFormat#"%#&access_token=%#",downloadUrl,accessToken];
pass the strPath to your avplayer object to play music.
I did not try the video part. but i think a similar approach should work.
you can fetch the access token from the GTMOAuth2Authentication object
Note that you might need to refresh it if its expires.
Hope this helps you.
Regards
Nitesh
I think it depends what you mean by "stream". Last time I looked, the download links all had a content disposition: attachment header, which instructs the browser to download rather than render the content.
If you have your own client fetching the url, you can choose to ignore that header and do what you like with the content as it is fetched. imho, it would be nice if the client could add a parameter to the url to indicate to the Google servers that it wants the content to be rendered v. downloaded, but hey ho.
You need to authorize all requests to downloadLinks with an Authorization header. Read more about the authorization and learn how to retrieve your users an access token on https://developers.google.com/drive/about-auth