Fix the Web View shrink issue in iOS7 using PhoneGap

I received a bug ticket from my client about the unusual behavior of my application UI. It was a problem which was occurring only in iOS7 only.
When the keyboard pops up in iPad devices running on iOS7 the web view of our app gets shrink (app development using Phonegap).

Solution that works for me :
This problem can be solved in few steps.

  1. We need to go to Config.xml and inside the preference tag just need to set the value of KeyboardShrinksView to false.
  2. Continue reading

Signing Identities and Certificates in iOS

When we start off as an iOS Developer, we all face a common obstacle ,that is generating the certificates and using it in our apps because Apple does not allow us to debug or run our app without Certificate. So we need an Apple Developer Certificates to develop ,debug and run.

In order to know the types and procedure to use it, first we need to have an understanding of code signing and why it is needed. So lets start with it.

Code signing our app is necessary because due to this only users trust that our app has been created by a source known to Apple. All iOS apps must be code signed and provisioned to launch on a device or to be distributed for testing, or to be submitted to the store. Continue reading

Add Core Data to an Application in Xcode

Who should read this Blog: User must know about Basic Concept of CoreData. Those who want to convert their non-Core data Application to a Core Data Application. Those who have some experience working with iOS Application. You must have a Sample Project to which you can convert it to CoreData Project.

So Let’s get started with Step by Step Process.

  1. First and Foremost is to Add CoreData.framework to the application directory.
  2. Now you need to add data model to your Application.

How can you do this?

Go To File-> New File->iOS->Core data->Data Model
Select Next and Give appropriate Name to your Data Model

Continue reading

Implementing Google Analytics in iOS application

When a mobile application is developed for a wide range of users across the world, then the performance of the application becomes a priority. The marketing panel of the application needs to keep a track of the overall performance of the application throughout the world off the shelf.

Google Analytics is such a framework that provides the answer to all such aspects that only the marketers as well as the developers are looking for to implement in their mobile application. So, “What is ‘Google Analytics’?” 

In simple terms Google Analytics is a service offered by Google that generates detailed statistics about a website’s or mobile application’s traffic. The Google Analytics lets you measure user interactions with your business across various devices and environments. This platform provides all the computing resources to collect the information about the application, stores and processes it and provides a detailed report out of it.

Continue reading

Copy existing sqlite database into PhoneGap iOS application

Usually PhoneGap supports SQLite database to interact locally. There might be a scenario where we need to create the database freshly or sometimes need to use the existing database. The idea of writing this blog came to my mind while encountered a question in stackoverflow site.  In this blog we will focus on importing existing database into our PhoneGap application and use the same to interact with our application.

Lets have a pre-populated database having tables with data which needs to be imported to our application. It will help us to minimize our effort in creating the database freshly to the application on its startup. For this we need to follow the bellow steps.

Step 1 : Remove the .sqlite extension from the sqlite database. Ex. If we have the database called DummyDB.sqlite make it only DummyDB.
Continue reading

Three Steps to Create Push Notification Enabled iOS Application

Apple push notification service. As an iOS Developer we often heard the term APNS. Let’s explore this cool feature of iOS device. APNS is Apple push notification services. By using this service we can send required information to the respective user’s application accordingly. This seems quit confusing so lets make it simple and clear.

As iOS application provide a very negligible scope to tackle things when the application is in background. Apple has provided a solution to this. In spite of, let your application track what new is available for user on the server side. you can write a script on your server to let your application what all updates it has. You can send three type of information using APNS:

Continue reading

Urban Airship integration to receive Push Notification in iOS using PhoneGap

Push Notification is a mechanism, which allows an application to notify the user about any new events without opening the application, same as a SMS pops up on our mobile screen. Push Notification can work both in background and foreground, so this is a nice way to interact with the application in the background.

Urban Airship provides easy and effective solution to push the notification to user. It can act as as a middle layer which will help us to send the notification from our server routing it through the Apple Notification Server.
So in this blog we will discuss the use of Urban Airship to send push notification to our application. Here are the steps bellow, which will guide us in the process of integrating the Urban Airship plugin in iOS application using PhoneGap version 2.6.0.

Step #1:
Download the plugin for Urban Airship from github with this URL.
Continue reading

Apple’s iBeacon

With launch of iOS 7.0 Apple unveiled iBeacons. They are small range positioning systems based on Bluetooth Low Energy (BLE). This article thingy here, is to highlight the uses and increase its popularity (much deserved) among the consumers and developers alike.

With development of BLE i.e. Bluetooth 4.0 , battery usage has been significantly decreased (they claim it will last to 5-10 times as compared to Bluetooth 3.0). And Apple’s iBeacon is built upon the very same advantage.

iBeacon enables us to transmit and receive location of nearby (~50 meters) iBeacons (any device with Bluetooth 4.0 can be a iBeacon and yes, that includes Android devices also) which we can use to send Push Notifications. The reason I am drum-rolling here about the arrival of iBeacon is its capability to enhance user’s life multi-dimensionally.
Continue reading

How to Integrate Instagram into iOS Application and Share Photo With it

When we are into developing an iOS application related to social networking like posting photos or videos, then we are in need to integrate some of the well-developed social networking APIs into our application.

I also came across such a situation when I was working on an application which was to promote the Campaigns with the help of social media network “Instagram”. Instagram is a social networking service that allows its users to capture photos and videos, modify and share them with friends. So here I am to help you all with the easy integration of the Instagram API into our application.

Before I start, I would like to make clear what is it all about. In my blog I will deal with:

1. How to register your application in Instagram to fetch the “Client ID” for the application.
2. How to call the Instagram API to show the Instagram login screen and fetch the access token.
3. How to fetch the logged in Instagram user information using the access token.
4. How to share a photo with Instagram using iPhone hook.
5. What are the drawbacks of using iPhone hook and the possible way out for it.
6. How to clear the access token (clear the cookies).

So, let’s get started:

Continue reading

Upload Video to Server Using Multiparts in iPhone

This blog will help you in recording and uploading video to server using multiparts in iPhone.

We have two methods for sending video data to server:-

1. Video data is encoded before sending data to server.
2. Video data is encoded after receiving complete data to server.

We can encode video data before sending data to server, but at the same time we have some drawbacks like time issues, lagging effects. Thats why we have preferred the second option, where we are recording the video and send video data to server using “multipart”. When data successfully received at server side, then encoding part would be done on server side only. This method will prevent the app from time and lagging effects.

In the case of multiple part messages, in which one or more different sets of data are combined in a single body, a “multipart” Content-Type field must appear in the entity’s header. The body must then contain one or more “body parts,” each preceded by an encapsulation boundary, and the last one followed by a closing boundary. Each part starts with an encapsulation boundary, and then contains a body part consisting of header area, a blank line, and a body area.

Continue reading