Orange’s grove

Orange’s grove

 

The sight de-fills my gloom
And brings warmth.
Playful, happy and serene
Flirts with morning dew;
Throwing golden shine
Under flicker of the bountiful.
Hanging with grace the orbs of time
Filled with fragrant serum.
I imagine it only to be sweet
Nurtured from burn and sweat.

– Padam ‘Paddy’ Thapa

Free

Free

Distant from waves of emotion
Secluded from flock of all affection
Is the soul —carefree & innocent—
Collecting dreams on the shore purest

 

– Padam ‘Paddy’ Thapa

Doll’s Secret

Doll’s Secret

She speak no truth, no lie;
She speak moments passing by.
She neither assent nor demur
Unlike bloomed or withered fleur

Eyes cries not and smiles not;
Through eyes – lies the secret –
No other will find ever:
How the keeper stayed young forever

– Padam ‘Paddy’ Thapa

It

Nothing is a perfect hope.
Nothing is a perfect despair.
Yet ‘T struggles to cope
With an imagination in air!

Nothing is a perfect love.
Nothing is a perfect hate.
Yet ‘T bleeds either way
but never wait!

-Paddy

Check if Push Notification is enabled

We had our own flow of app permissions to be presented through our UX. Push notification was one of the permissions. For an early and simple start, my requirement was to know if an app has the permission for push notification. I used following code:

[[UIApplication sharedApplication] isRegisteredForRemoteNotifications]

Result was different on simulator and real device. On simulator it always returned NO, while it worked well on device until iOS 10.

Next, the reliable way(example) that I learned and worked across was:

- (BOOL)isPushNotificationsEnabled {
    if ([[UIApplication sharedApplication] respondsToSelector:@selector(currentUserNotificationSettings)]) {
        UIUserNotificationType types = [[[UIApplication sharedApplication] currentUserNotificationSettings] types];
        return (types & UIUserNotificationTypeAlert);
    }
    else {//Before iOS8
        UIRemoteNotificationType types = [[UIApplication sharedApplication] enabledRemoteNotificationTypes];
        return (types & UIRemoteNotificationTypeAlert);
    }
}