# j-NativeNotifications

> j-NativeNotifications: jednoduché použitie; singleton

Framework: jcomponent20
Product: jComponent 20 (jcomponent@20)
Language: sk
Content-SHA256: 306baedb524f1d32c6681a1f40615c3ee750c34af67fe6ea2c64c6974331998a
Snapshot: c0700e321579725c5cf4f5ace1ad7d2866d1b4f93c24a63c0b41b6b7998e976c
Sources: components@910ed1a86f6e72b4f031d3ad0dc7844f9fc5cb8e
Review: not-recorded

- singleton


__Konfigurácia__

- `timeout {Number}` musí obsahovať časový limit (milisekundy) na uplynutie platnosti upozornenia (predvolené: `8000`)
- `icon {String}` (voliteľné) ikona (predvolené `/icon.png`)

__Metódy__
- `component.append(title, message, [callback], [icon])` na vytvorenie nového oznámenia

__Použitie__

```javascript
SETTER('nativenotifications/show', 'TITLE', 'MESSAGE', function() {
    // optional, click
}, '/img/warning-optional.png');
```

Použite ho so `<ui-component name="nativenotifications">`. Keď komponent ešte nie je načítaný, jComponent ho stiahne pri prvom použití z adresy v `DEF.fallback` (predvolene CDN Componentator). Autor: Peter Širka. Zdroj: úložisko komponentov Componentator, licencia MIT.

```html example.html
<ui-component name="nativenotifications" path="allowNotifications"></ui-component>

<script>
	var allowNotifications = true;

	setTimeout(function() {
		SETTER('nativenotifications/append', 'Hello!', 'jComponent is a great solution for everyone.', null, 'https://messenger.totaljs.com/icon.png');
	}, 3000);
</script>
```
