Friday, September 16, 2016

Upgrading to iOS 10

This time, had to download the profile from iOS device. I chose an iPhone 5s for upgrade.

This can be found here https://beta.apple.com/sp/betaprogram/guide

- After installing the profile, it restarted the phone. 
- Visiting the General Settings, > Software updates, it shown download option to update to the latest software
- Select for Download, the download was around 1.6 GB
- After download, it changed to Install now

- Installing did restart the phone and the update was successfully done

Notes from Sails tutorial - Part 1

Below are few benefits of it.

Auto generated API
Database ORM
Inbuilt task runner
Security code
Built-in web sockets in routes.
Unlike MEAN stack, where you need to create API's manually and do same repetitive thing again and again, Sails.js allows you to automatically create skeleton APIs. Just a single command, and you will have block of code generated to get you started.

Additionally, Sails.js provides database drivers for every major database systems such as MySQL, MongoDB, PostgreSQL. Sails.js uses Grunt task runner as the default task runner, and also provides an effective way to manage custom grunt tasks.

Furthermore, common security parameters such as CORS and CSRF are already included in Sails.js project. All you need to do is to enable them from respective files and your application is secured with the latest security standards.

Sails.js uses Express to handle HTTP operations and Socket.io to handle web socket messages. It provides web socket messages to your routes without configuring it in back-end or front-end layer.

The controllers and model folders are the most important. Controller contains every piece of the code your application needs to drive a backend system and communicate with the View or User interface.

Model contains how the object in data store will look like. So, if you are using a relational database, then it will be a table in database and JSON object in model file, or if you are using NoSQL databases such as MongoDB, then it will be collection under model.

The database connection is configured in config/connections. Since i was planning to use mongo db, it was like below 

someMongodbServer: {
    adapter: 'sails-mongo',
    host: 'localhost',
    port: 27017,
    // user: 'username',
    // password: 'password',
    database: ‘mymongodb’
  } 

user name and password is commented so that it does not ask for any 

in config/model.js, we can configure to use this connection and tell it to sails. 

connection: 'someMongodbServer',


references:

Tuesday, September 6, 2016

iOS how to resign an application

Problems because of the adhoc builds released for internal testing got expired by its provisioning profile? There is a utility to resign such ipa files easily.

iResign is an application which can be downloaded from the link below which helps to do this easily.

As can be seen in the UI, just select the ipa to resign, select the provisioning profile to be used and the Certificate information. Click resign and thats it. it generate the ipa which is ready to be installed again working.

 


Based on experience, it appears that the installation of the signed one fails if don’t give the bundle id at the time of resign.

references:
https://github.com/maciekish/iReSign

iOS Stack View - Working well with Auto layout.

In combination with Auto Layout, one of the most useful tools for working with layouts like the one you have is stack view (UIStackView). A stack view provides a streamlined interface for laying out a collection of views in either a column or a row. Stack views let you leverage the power of Auto Layout, creating user interfaces that can dynamically adapt to the device’s orientation, screen size, and any changes in the available space.

Lets say we have to create a UI like this below 

Lets divide the task into below steps

Step 1: add the UI elements to the scene
just drag 2 labels, 2 text fields and a button to the scene so that it looks below 


Step 2: Embed the UI elements in UIStackView

Shift select all of the added elements and Editor > Embed In > Stack View 

This shows like below 

Step 3: Now align the Stack view to the centre of the screen by using Align and Pin tools 

After the alignment, it will look like the below. 

Step 4 : Align the components within stack view


Select the Text fields individually and add Pin to the edges of the stack view. 

Thats it. the screen is ready. Just change the label to have required text and the background color for the text fields. 

references:

Monday, September 5, 2016

Mac - How to remove the iOS provisioning profiles

This can be done in below 3 steps

1. Navigate to the profiles folder on Mac machine

The profiles are under the directory ~/Library/MobileDevice/Provisioning Profiles

2. Search for profile if any already exist with same bundle id, which could have been already expired or signed with another identity.

The search can be done in the above folder with grep -lr "com.myserver.ppt" *
If the profile exist, this will list the filename(s) having this key.

Now delete the old profile

3. Generate the new profile from developer console and click to install it.

This ensure the Mac is having the latest profile available.
to Note, if the certificate is already expired, then one should install the certificate too, which is by opening the .p12 file that is given to the developer and providing the password to it.

references:
http://stackoverflow.com/questions/26732251/how-to-remove-provisioning-profiles-from-xcode-6-and-xcode-7