Merge pull request #51 from ijansch/master

Upgrade to latest xcode recommended settings.
Blocks should be copied into array
Merge pull request #52 from johankool/master

Blocks should be copied into array
Fixed stale notificationtoken after the first registration.