Files
react-native-notifications/docs/ios-api/index.html
yogevbd 9c2943cb95 Deploy website
Deploy website version based on 27b0f174fd
2020-01-15 17:17:19 +02:00

94 lines
15 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><title>iOS Specific Commands · React native notifications</title><meta name="viewport" content="width=device-width"/><meta name="generator" content="Docusaurus"/><meta name="description" content="## requestPermissions()"/><meta name="docsearch:language" content="en"/><meta property="og:title" content="iOS Specific Commands · React native notifications"/><meta property="og:type" content="website"/><meta property="og:url" content="https://wix.github.io/react-native-notifications/"/><meta property="og:description" content="## requestPermissions()"/><meta property="og:image" content="https://wix.github.io/react-native-notifications/img/undraw_online.svg"/><meta name="twitter:card" content="summary"/><meta name="twitter:image" content="https://wix.github.io/react-native-notifications/img/undraw_tweetstorm.svg"/><link rel="shortcut icon" href="/react-native-notifications/undefined"/><link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css"/><script type="text/javascript" src="https://buttons.github.io/buttons.js"></script><script src="/react-native-notifications/js/scrollSpy.js"></script><link rel="stylesheet" href="/react-native-notifications/css/main.css"/><script src="/react-native-notifications/js/codetabs.js"></script></head><body class="sideNavVisible separateOnPageNav"><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/react-native-notifications/"><h2 class="headerTitle">React native notifications</h2></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li class=""><a href="/react-native-notifications/docs/installation-ios" target="_self">Docs</a></li><li class="siteNavGroupActive"><a href="/react-native-notifications/docs/general-api" target="_self">API</a></li></ul></nav></div></header></div></div><div class="navPusher"><div class="docMainWrapper wrapper"><div class="docsNavContainer" id="docsNav"><nav class="toc"><div class="toggleNav"><section class="navWrapper wrapper"><div class="navBreadcrumb wrapper"><div class="navToggle" id="navToggler"><div class="hamburger-menu"><div class="line1"></div><div class="line2"></div><div class="line3"></div></div></div><h2><i></i><span>Commands</span></h2><div class="tocToggler" id="tocToggler"><i class="icon-toc"></i></div></div><div class="navGroups"><div class="navGroup"><h3 class="navGroupCategoryTitle">Commands</h3><ul class=""><li class="navListItem"><a class="navItem" href="/react-native-notifications/docs/general-api">General</a></li><li class="navListItem navListItemActive"><a class="navItem" href="/react-native-notifications/docs/ios-api">iOS specific</a></li><li class="navListItem"><a class="navItem" href="/react-native-notifications/docs/android-api">Android specific</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">Events</h3><ul class=""><li class="navListItem"><a class="navItem" href="/react-native-notifications/docs/general-events">General</a></li><li class="navListItem"><a class="navItem" href="/react-native-notifications/docs/ios-events">iOS specific</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">Objects</h3><ul class=""><li class="navListItem"><a class="navItem" href="/react-native-notifications/docs/notification-object">Notification</a></li></ul></div></div></section></div><script>
var coll = document.getElementsByClassName('collapsible');
var checkActiveCategory = true;
for (var i = 0; i < coll.length; i++) {
var links = coll[i].nextElementSibling.getElementsByTagName('*');
if (checkActiveCategory){
for (var j = 0; j < links.length; j++) {
if (links[j].classList.contains('navListItemActive')){
coll[i].nextElementSibling.classList.toggle('hide');
coll[i].childNodes[1].classList.toggle('rotate');
checkActiveCategory = false;
break;
}
}
}
coll[i].addEventListener('click', function() {
var arrow = this.childNodes[1];
arrow.classList.toggle('rotate');
var content = this.nextElementSibling;
content.classList.toggle('hide');
});
}
document.addEventListener('DOMContentLoaded', function() {
createToggler('#navToggler', '#docsNav', 'docsSliderActive');
createToggler('#tocToggler', 'body', 'tocActive');
var headings = document.querySelector('.toc-headings');
headings && headings.addEventListener('click', function(event) {
var el = event.target;
while(el !== headings){
if (el.tagName === 'A') {
document.body.classList.remove('tocActive');
break;
} else{
el = el.parentNode;
}
}
}, false);
function createToggler(togglerSelector, targetSelector, className) {
var toggler = document.querySelector(togglerSelector);
var target = document.querySelector(targetSelector);
if (!toggler) {
return;
}
toggler.onclick = function(event) {
event.preventDefault();
target.classList.toggle(className);
};
}
});
</script></nav></div><div class="container mainContainer docsContainer"><div class="wrapper"><div class="post"><header class="postHeader"><h1 id="__docusaurus" class="postHeaderTitle">iOS Specific Commands</h1></header><article><div><span><h2><a class="anchor" aria-hidden="true" id="requestpermissions"></a><a href="#requestpermissions" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>requestPermissions()</h2>
<p>Requests notification permissions from iOS, prompting the user's dialog box.</p>
<pre><code class="hljs css language-js">Notifications.ios.requestPermissions();
</code></pre>
<h2><a class="anchor" aria-hidden="true" id="checkpermissions"></a><a href="#checkpermissions" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>checkPermissions()</h2>
<p>See what push permissions are currently enabled.</p>
<pre><code class="hljs css language-js">Notifications.ios.checkPermissions();
</code></pre>
<h2><a class="anchor" aria-hidden="true" id="abandonpermissions"></a><a href="#abandonpermissions" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>abandonPermissions()</h2>
<p>Unregister for all remote notifications received via Apple Push Notification service.</p>
<p>You should call this method in rare circumstances only, such as when a new version of the app removes support for all types of remote notifications. Users can temporarily prevent apps from receiving remote notifications through the Notifications section of the Settings app. Apps unregistered through this method can always re-register.</p>
<pre><code class="hljs css language-js">Notifications.ios.abandonPermissions();
</code></pre>
<h2><a class="anchor" aria-hidden="true" id="registerpushkit"></a><a href="#registerpushkit" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>registerPushKit()</h2>
<p>Register for PushKit notifications</p>
<pre><code class="hljs css language-js">Notifications.ios.registerPushKit();
</code></pre>
<h2><a class="anchor" aria-hidden="true" id="cancelalllocalnotifications"></a><a href="#cancelalllocalnotifications" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>cancelAllLocalNotifications()</h2>
<p>Cancels all scheduled localNotifications</p>
<pre><code class="hljs css language-js">Notifications.ios.cancelAllLocalNotifications();
</code></pre>
<h2><a class="anchor" aria-hidden="true" id="getdeliverednotifications"></a><a href="#getdeliverednotifications" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>getDeliveredNotifications()</h2>
<p>Provides you with a list of the apps notifications that are still displayed in Notification Center</p>
<pre><code class="hljs css language-js">Notifications.ios.getDeliveredNotifications();
</code></pre>
<h2><a class="anchor" aria-hidden="true" id="removedeliverednotifications"></a><a href="#removedeliverednotifications" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>removeDeliveredNotifications()</h2>
<p>Removes the specified notifications from Notification Center</p>
<pre><code class="hljs css language-js">Notifications.ios.removeDeliveredNotifications(identifiers);
</code></pre>
<h2><a class="anchor" aria-hidden="true" id="getbadgecount"></a><a href="#getbadgecount" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>getBadgeCount()</h2>
<p>Gets the badge count number from the aps object</p>
<pre><code class="hljs css language-js">Notifications.ios.getBadgeCount();
</code></pre>
<h2><a class="anchor" aria-hidden="true" id="setbadgecount"></a><a href="#setbadgecount" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>setBadgeCount()</h2>
<p>Sets the badge number for the app icon on the home screen</p>
<pre><code class="hljs css language-js">Notifications.ios.setBadgeCount(<span class="hljs-number">1</span>);
</code></pre>
</span></div></article></div><div class="docs-prevnext"><a class="docs-prev button" href="/react-native-notifications/docs/general-api"><span class="arrow-prev"></span><span>General</span></a><a class="docs-next button" href="/react-native-notifications/docs/android-api"><span>Android specific</span><span class="arrow-next"></span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#requestpermissions">requestPermissions()</a></li><li><a href="#checkpermissions">checkPermissions()</a></li><li><a href="#abandonpermissions">abandonPermissions()</a></li><li><a href="#registerpushkit">registerPushKit()</a></li><li><a href="#cancelalllocalnotifications">cancelAllLocalNotifications()</a></li><li><a href="#getdeliverednotifications">getDeliveredNotifications()</a></li><li><a href="#removedeliverednotifications">removeDeliveredNotifications()</a></li><li><a href="#getbadgecount">getBadgeCount()</a></li><li><a href="#setbadgecount">setBadgeCount()</a></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/react-native-notifications/" class="nav-home"></a><div><h5>Docs</h5><a href="/react-native-notifications/docs/getting-started">Getting Started (or other categories)</a><a href="/react-native-notifications/docs/installation-ios">Guides</a><a href="/react-native-notifications/docs/general-api">API Reference</a></div><div></div><div><h5>More</h5><a href="/react-native-notifications/blog">Blog</a><a href="https://github.com/wix/react-native-notifications">GitHub</a><a class="github-button" href="https://github.com/wix/react-native-notifications" data-icon="octicon-star" data-count-href="/facebook/docusaurus/stargazers" data-show-count="true" data-count-aria-label="# stargazers on GitHub" aria-label="Star this project on GitHub">Star</a></div></section><section class="copyright">Copyright © 2020 Wix</section></footer></div></body></html>