Rails 3: Render differently if email is opened on an iPhone? - iphone

I have an email which renders perfectly on a standard machine. However, when a user opens the email on their iphone there is a gray box that suddenly enlarges and takes up more space than it normally should. Is there a hack that I can use in order to have my html.erb page recognize whether or not it is being rendered in an iphone and adjust itself accordingly?

Its basically the CSS you would have to modify in general.
Follow this link showing which styles etc. are supported on iphone devices and which are not..

In order to get user's browser information, there is a cool gem called Browser. I strongly recommend you to check out its repo on Github.
Once you install this gem,
browser.mobile?
will give you true or false and you'll be able to do whatever you want depending on the answer.

Related

iOS email client testing

I made an email HTML template. It is developed using some tables with 2 columns.
If I watch this email with some clients in different devices everithing looks good. But if I watch the email with an iPhone (of my friend) my template become 1 column, images become bigger, tables with border and some other problems.
I don't have an apple device, so testing is very difficult. what I'm asking here is if exist a way to emulate the iOS mail client or other any suggestions are appreciate.
Thanks
Look into using Google Chrome. It's based on webkit, an open source browser engine which is also what IOS uses to render emails.
When you use Inspect mode, it gives you a list of devices it can emulate. I can't verify right now that it's the same list for Windows or linux. It's close.
It's not a replacement for using actual devices or a services like Email on Acid or Litmus, but it gets you some feedback on how your design looks on other devices and it's free.
Good luck.
Confirmed: I finally got Windows 10 working and I can confirm that Google Chrome allows you to Inspect your code and emulate the look on an iPhone, iPad, Galaxy or Pixel device. You can customize to add specific devices (if available).
This is exactly what you are after:
https://litmus.com/email-testing
I have used this a lot! And it works really well!
Also, try and take a look at this:
https://www.campaignmonitor.com/css/
Really nice tool to check what's compatible in different e-mail clients.

How do I make my Heroku app available to see for others who have the link?

So I deployed my first app, I am able to use it on my computer, but when I typed in the address on my phone or sent it to my friends they say it is just a blank page. How can I make it so others could see my app? Could find any answers, I am doing this for my portfolio, also i deployed using Github method.
So I made a mistake, it was actually delivering to users, but and the background color was showing, but React was not rendering because of some development-only script, had to do a function that would detect if app is in production or development and therefore apply the script or not.

Website seems to be fine on everything but iphone

I am building a website for a friend and it's just about done, apart from a bit more content, but now he tells me that it doesn't look right on his iphone. I have checked it on Safari, Opera, IE, Chrome and Firefox on laptop, and on my Android phone and on web-based iphone emulators and everything looks fine. I had him check on someone else's iphone and 1 of the problems goes but the other remains. My site is pretty basic, html and css only, but I am the first to admit that as I am new to this my code could probably be better.
The first issue is that above the header his iphone shows there are what's best described as 5 red bricks evenly spaced along the top. This doesn't show on his mates iphone.
The second issue is that on the "products" page, the right column text under the pictures isn't lined up properly, which is the case on his mates iphone. I don't know what to do here because if I alter the padding I used to line things up, it won't be right on every other browser/device.
I'm not sure what I'm best posting on here, the whole code for the site seems too much, but whatever needed to help answer just let me know. The site address for the products page is http://www.doortodoordrinksyork.com/products.html
Like I say I'm new to this so please keep answers simple.
Thanks in advance.
David.
PS Would appreciate anyone with an iphone telling me how the site displays on it.
If you use a Mac, you can use the iOS Simulator tool that comes with XCode to test out your site in a virtual iPhone/iPod. You can even compare different versions of the built-in browser, which I think is what's causing the difference between your mate's devices.
In general, well-built sites will 'work' without modification on mobile devices, but you may want to look into media queries, a CSS feature that lets you target specific screen sizes with different rules.

How to build correctly Android-compatible website?

I am HTML/CSS/jQuery coder. And I need to develop the website, which will be "zoomed-out" or "fitted" to 320x480 (frequently used resolution) Android mobile device screen.
Or even this solutions should check my screen resolution and connect the right CSS for that.
Somewhere I met that there is android.js file, which connects to HTML and recognizes if the website was open on PC or on android device. But I am not sure at all. I didn't do anything for mobiles before.
Found this article: http://blog.mgpwr.co.uk/2010/09/make-your-website-iphone-compatible/
Don't think it's a right solution to use PHP for that.
Better would be HTML or JS.
A very simple answer would be don't hardcode width on the elements and don't specify font size in pixels. The mobile browser will adjust the rendered page itself.
If however you want more iPhone-like look of form controls like radio buttons, buttons, drop downs, then you need to use the mobile javascript libraries outlined in the other answer.
A simple answer would be a mobile javascript library such as one of the following:
http://www.sencha.com/products/touch/
http://www.phonegap.com/home/
http://jquerymobile.com/
http://jqtouch.com/

Simplest way to incorporate iPhone file upload when building app with Appcelerator's Titanium Developer

Sorry for the long explanation. Thanks in advance to all who are taking their time.
I am an Ubuntu user who has set up Titanium Developer on a MacMini in order to build an app for the iPhone (and ultimately some other platforms).
Rather than having any local code built in, the app simply points to my website. To do that, all I needed to do was change Titanium's tiapp.xml file to include my website URL. I wrote no other code, nor did I need to include any other files. It simply compiled and ran in the emulator without a hitch.
I've got just one problem: I need to upload files to my website and Apple, as most of you know, has disabled the input field type=file. I've got it working in all other browsers. The action simply calls a php file and passes the file info.
If I didn't have an app, and someone was just manually navigating to my site with the iPhone's Safari browser, I could get around the problem by using CliqCliq, which is a very cool iPhone app. Basically, I use JavaScript window.open() to launch CliqCliq's QuickPic browser in a second Safari window. The user chooses a file; QuickPic uploads it; and the user is returned to the second Safari window that I launched with window.open(). The user closes the window and Safari returns them to the first window (i.e., my website).
The problem is that my website is being shown in my app. (By the way, I don't have my developer license yet, even though I signed up a few weeks ago, and I can't test this in the emulator because I can't install QuickPic into it, I assume.) I wanted to repeat the same steps, described in the previous paragraph, using an iFrame but that didn't seem to work (i.e., the iFrame was blank despite my designating a src). I also tried having a hidden window by using old-fashioned frames and setting the col-width to 0. That also did not work (i.e., Safari, if I recall correctly, opened a separate window).
I'm working a little blind, since I can't test anything on the iPhone, but I figure I have two options: I can either find a way to launch a QuickPic in an iFrame -or- I can find some way to incorporate the Apple toolkit file chooser into the Titanium app.
The problem with the first option -- but again, I don't know until I can try this on the iPhone -- is that I assume both apps (mine and CliqCliq's) could not run at the same time. Even if I had a hidden window, invisible iFrame, etc., the moment it launches QuickPic, I assume my app would quit(?).
The problem with the second option is that I don't have clue as to how to incorporate a file picker into my app by using Titanium (keeping in mind, everyone, that I know very little). Brian at CliqCliq has even offered to give me some code if I can't make Apple's file picker work but again, I'm not sure what to do next.
What do you folks think? What's the best method? And, what's the easiest thing for a simpleton to do?
Thanks.
<input type="file"> is not supported on the iPhone. You'll need to use Titanium's APIs, specifically the Media one (openPhotoGallery or showCamera).
As a side note, Apple reportedly rejects apps that are just a webview displaying a website. You may want to consider putting most of the app code in local storage and using AJAX to fetch content.