Detect Screen Orientation in an Ionic 3 in IOS App

There are many situations while developing mobile apps when you need to get the orientation of the device. For example, you need to show another layout in landscape mode or even lock the device orientation. If you’ve been keeping up with making apps using Ionic, you should know the Cordova Orientation Plugin.

To understand how to use orientation plugin, let’s create a real Ionic 3 example.

Getting started

To follow this tutorial you should have the basic fundamentals of the command line and Ionic.
All the following was done using Ionic v.3.19.1 and Ionic DevApp.

1. Create a New Ionic 3 Application

Let’s create an Ionic example using the following command:

Go to your newly created project:

2. Install the Orientation plugin

To make manipulations with orientation in our example, we’re going to make use of the Apache Cordova plugin. It can be installed by executing the following commands:

After installation, we should set up this plugin into our app.

Our src/app.module.ts should look like this:

3. Configure

Let’s start with getting the current orientation and showing it on default-generated.HomePage We just need to integrate Screen-Orientation plugin to HomePage and into a constructor.

Remember, that Screen-Orientation plugin is using native device functionality, so we need to be sure this platform is ready.

Our src/pages/home/home.ts should look like this:

Our src/pages/home/home.html should look like this:

I tested this example directly on my iPhone using Ionic DevApp. I launched app using the ionic serve -c ommand terminal and opened it in Ionic DevApp. If all is ok, you should see the next:

Portrait-primary orientation

 

After rotating phone the text will not changes because we not observing the value of the orientation. To listen to the changes, we should change  src/pages/home/home.html in a next way:

After updating this code, you can rotate your phone and see the next:

After rotating upside down

 

After rotating the phone to the left

Also, you can keep one orientation for all app or just one page. For example, let’s set only the landscape mode for HomePage. It means HomePage can be in landscape-primary and landscape-secondary modes. We can do it with the single line:

Edit src/pages/home/home.ts to reflect the following:

 

Summary

As you can see, you can lock orientation or set specific orientation not only for the whole app but for a specific page. Also, you can configure orientation for your whole app in the Xcode.

If you have any questions, advice, feel free to leave them in the comments!

Apple redesigned the Web Version of App Store

Today, Fri Jan 19, 2018 I found that preview page for the app in App Store was changed.

I prepared screens of old and new versions of preview App Store. You can check new design directly on App Store.

Previous version:

Old version of Web App Store
Old version of Web App Store

New version:

New Version of Web App Store 1
New Version of Web App Store 1
New Version of Web App Store 2
New Version of Web App Store 2

What has changed:

– The user can see more screenshots of the app in the new version. In the previous version, the user needed to horizontal scroll.
– Screenshots became enlarged
– 6 apps in “More by This Developer” instead of 5 in the previous version
– Same for “You May Also Like” apps block
– A lot of empty space to the right of the icon
– In general, the page became longer. The user needs to scroll the page in contrast to the previous version

Also, “Customer reviews” have become like this (screenshot from “Pokemon Go” App):

New App Store Customer Reviews
New App Store Customer Reviews

Summary:

The page became bigger and more space appeared. The previous version was more compact.

How to create IOS build of Travelpayouts SDK without Fabric?

if you building a project using Travelpayouts SDK for IOS, you can encounter a problem with Fabric library, when you want to archive a project. It’s looking like this:

Travelpayouts SDK IOS Fabric issue
Travelpayouts SDK IOS Fabric issue

Fabric/Crashlytics – it’s using for track crashes of the app and to use it, you need to register an account on Fabric.io, get API Key and Build Secret to successfully archive a project to .ipa.

To avoid this issue you need to add API Key and Build Secret to the configuration of your app. But, if you don’t want to share any data of your app and just archive it and upload to App Store, you need the next solution. Just comment the lines on the picture or remove build phase for Fabric Script:

Quick Fix For Fabric
Quick Fix For Fabric

 

Hope, it will help you.

How Much Money Can You Earn With an Android or IOS App?

Some time ago I found an interesting and simple resource – Bootstrap.money, which show how much you can earn by selling product or service by different popular platforms – Stripe, Paypal, Gumroad, App Store, Play Store, Windows Store and Direct. The advantage of this service – its automatically calculate a commission for each platform through which you will sell your product or service.

Commission for each platform
Commission for each platform

 

For example, if you have an app on App store, which cost $2.99 and you want you to earn 10000$ only from this app, you need to have your app purchased by 4778 customers:

 

App purchased by 4778 customers
App purchased by 4778 customers

So, using this site, you can easily estimate the revenue from your product or service including all fees.

[IOS] Polski Kodeks Karny – 10 promocodes

Polski Kodeks Karny was released to App Store. Now you can use it on your IOS device.
I gift you 10 promo codes to install this app for free. The next codes are able from 27.10.2017 until 27.11.2017. Try them:

Polski Kodeks Karny zostaƂ wydany do App Store. Teraz moĆŒesz uĆŒywać go na swoim urządzeniu IOS.
Darujesz 10 kodów promocyjnych, aby zainstalować tę aplikację za darmo. Następne kody są w stanie od 26.09.2017 do 24.10.2017. Spróbuj ich:

Y797TY9FWFXH
HA3EYYTEKPAW
T7Y9XRR4TLAW
MMHYPTNFW4HP
9P7MTJH6H7PR
WFT4X4TRJ4FY
4ART6Y93TP9E
N7NMF37Y4RN4
H6PXWHTENM9N
ATEAMN3JPJ3L