GithubHelp home page GithubHelp logo

isabella232 / badgecountdemo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pubnub/badgecountdemo

0.0 0.0 0.0 18 KB

iOS Demo using history to perform background badge counts

License: MIT License

Ruby 1.45% Objective-C 98.55%

badgecountdemo's Introduction

push-demo

This was best practice on iOS 9 but is no longer best practice for iOS 10, use at your own discretion

Run "pod install" in root directory of repo to install pods and only open Push.xcworkspace

Need to have proper provisioning profiles and APNS certs. If you need help, go here.

To increment badge count, tap "publish" button in first view controller (from another device or sim!) or run curl command below:

curl 'https://ps5.pubnub.com/publish/pub-c-366ee301-3a9a-41ca-b3f2-d9dba11dbd10/sub-c-66eb5ede-fb1c-11e3-bacb-02ee2ddab7fe/0/teddyr/0/%7B%22pn_apns%22%3A%7B%22aps%22%3A%7B%22content-available%22%3A1%7D%7D%7D?uuid=073658ad-c8b2-44c4-9441-b59632b9c427'

This will cause the badge to increment for the app on a device (only apps on a device can receive push notifications!).

Note

This will fail to work under either condition:

  • App has not been launched since the last restart
  • App was force killed in app switcher

Background execution is kicked off by iOS itself, and is not necessarily instantaneous. It might a few seconds before execution begins, but shouldn't be more than a minute or two. Excecution involves 1 or more history calls, which is an API request. The client gets a maximum of 30 seconds to execute any code before it is stopped. Move quickly!

badgecountdemo's People

Contributors

jzucker2 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.