mirror of
https://github.com/Finb/Bark.git
synced 2025-12-08 21:36:01 +00:00
Compare commits
4 Commits
8b49d6cc96
...
89416757d9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
89416757d9 | ||
|
|
c6719a680d | ||
|
|
cc223e0744 | ||
|
|
1a30eb55a8 |
@ -894,6 +894,7 @@
|
||||
Base,
|
||||
"zh-Hans",
|
||||
tr,
|
||||
ja,
|
||||
);
|
||||
mainGroup = 0661A536204FDA4100965E4E;
|
||||
productRefGroup = 0661A540204FDA4100965E4E /* Products */;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -8,6 +8,4 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
let kStopCallProcessorKey = "stopCallProcessorNotification"
|
||||
let kBarkSoundPrefix = "bark.sounds.30s"
|
||||
|
||||
@ -24,7 +24,6 @@ class NotificationService: UNNotificationServiceExtension {
|
||||
|
||||
// 所有的 processor, 按顺序从上往下对推送进行处理
|
||||
// ciphertext 需要放在最前面,有可能所有的推送数据都在密文里
|
||||
// call 需要放在最后面,因为这个 Processor 不会主动退出, 会一直等到 ServiceExtension 被终止
|
||||
let processors: [NotificationContentProcessorItem] = [
|
||||
.ciphertext,
|
||||
.level,
|
||||
|
||||
@ -15,10 +15,10 @@
|
||||
|
||||
### 免费
|
||||
Bark **2018年7月**上线,至少会维持运营到 **2031年7月** 。*(说不出口“永久”这个词,后续还有需求再续吧)*<br>
|
||||
APP在维持期间,不会有任何形式的收费与广告,各位彦祖放心使用。
|
||||
APP在维持期间,不会有任何形式的收费功能与广告,各位彦祖放心使用。
|
||||
|
||||
### 赞助
|
||||
目前仅接收 GitHub 赞助,同时非常感谢每一位赞助者<br>
|
||||
目前接收 GitHub 赞助、App内内购赞助。非常感谢每一位赞助者!<br>
|
||||
赞助者:[https://github.com/sponsors/Finb](https://github.com/sponsors/Finb)
|
||||
|
||||
### 文档
|
||||
|
||||
@ -1,5 +1,3 @@
|
||||
* Translations
|
||||
- [:cn: 简体中文](/)
|
||||
- [:uk: English](/en-us/)
|
||||
- [:tr: Türkçe](/tr/)
|
||||
|
||||
- [:uk: English](/en-us/)
|
||||
@ -8,7 +8,7 @@ curl -X "POST" "https://api.day.app/push" \
|
||||
-d $'{
|
||||
"title": "Title",
|
||||
"body": "Body",
|
||||
"sound": "minuet.caf",
|
||||
"sound": "minuet",
|
||||
"group": "test",
|
||||
"device_keys": ["key1", "key2", ... ]
|
||||
}'
|
||||
|
||||
@ -28,6 +28,7 @@ Sponsors:[https://github.com/sponsors/Finb](https://github.com/sponsors/Finb)
|
||||
- [FAQs](/en-us/faq)
|
||||
- **Server**
|
||||
- [Deploy](/en-us/deploy)
|
||||
- [Batch Push](/en-us/batch)
|
||||
- [Build](/en-us/build)
|
||||
- [Certificate](/en-us/cert)
|
||||
- [Privacy](/en-us/privacy)
|
||||
@ -5,7 +5,7 @@
|
||||
> A privacy-focused, secure and controllable custom notification push tool.
|
||||
|
||||
- Free, simple and safe
|
||||
- Ready to use
|
||||
- Open and go
|
||||
|
||||
[GitHub](https://github.com/finb/bark)
|
||||
[Get Started](#bark)
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
- [FAQs](/en-us/faq)
|
||||
- **Server**
|
||||
- [Deploy](/en-us/deploy)
|
||||
- [Direct Push](/en-us/apns)
|
||||
- [Batch Push](/en-us/batch)
|
||||
- [Build](/en-us/build)
|
||||
- [Certificate](/en-us/cert)
|
||||
- [Privacy](/en-us/privacy)
|
||||
@ -1 +0,0 @@
|
||||
...
|
||||
35
docs/en-us/batch.md
Normal file
35
docs/en-us/batch.md
Normal file
@ -0,0 +1,35 @@
|
||||
|
||||
### Individual Users
|
||||
Batch push is only supported with Json requests, and bark-server needs to be updated to v2.1.9. ([https://api.day.app](https://api.day.app) will not be updated to v2.1.9 for now, and currently does not support batch push.)<br />
|
||||
Usage:
|
||||
```sh
|
||||
curl -X "POST" "https://api.day.app/push" \
|
||||
-H 'Content-Type: application/json; charset=utf-8' \
|
||||
-d $'{
|
||||
"title": "Title",
|
||||
"body": "Body",
|
||||
"sound": "minuet",
|
||||
"group": "test",
|
||||
"device_keys": ["key1", "key2", ... ]
|
||||
}'
|
||||
```
|
||||
|
||||
### Middleware Services
|
||||
If your service requires sending large volumes of push notifications to users in a timely manner, it is recommended to set up your own server. You can provide a Url Scheme to allow users to change the server with one click.
|
||||
|
||||
Url Scheme Example:
|
||||
```
|
||||
bark://addServer?address=https%3A%2F%2Fapi.day.app
|
||||
```
|
||||
bark-server has very low configuration requirements. Below are the QPS test results for various configurations on a US West VPS:
|
||||
|
||||
| Cores | Ram | Speed |
|
||||
| ----- | ----------- |----------- |
|
||||
| 1 | 3.75 gb |4,023 p/sec |
|
||||
| 4 | 16 gb |21,413 p/sec |
|
||||
| 16 | 64 gb |64,516 p/sec |
|
||||
| 64 | 256 gb |105,263 p/sec |
|
||||
|
||||
If QPS does not exceed 200, you can continue to use the public service([https://api.day.app](https://api.day.app))。<br />
|
||||
If QPS exceeds 200, it is recommended to set up your own server. In the future, when the public server is under high load, traffic restrictions may be introduced (currently, there are no restrictions).<br />
|
||||
If QPS exceeds 3000, it is strongly recommended to set up your own server and add the --max-apns-client-count parameter during deployment. For details, refer to the[Deployment Documentation.](/en-us/deploy)
|
||||
@ -1 +1,47 @@
|
||||
...
|
||||
## Download Source Code
|
||||
Download the source code from GitHub [bark-server](https://github.com/Finb/bark-server)
|
||||
|
||||
or
|
||||
```sh
|
||||
git clone https://github.com/Finb/bark-server.git
|
||||
```
|
||||
## Configure Dependencies
|
||||
- Golang 1.18+
|
||||
- Go Mod (env GO111MODULE=on)
|
||||
- Go Mod Proxy (env GOPROXY=https://goproxy.cn)
|
||||
- Install [go-task](https://taskfile.dev/installation/)
|
||||
|
||||
## Cross-Compile for All Platforms
|
||||
```sh
|
||||
task
|
||||
```
|
||||
|
||||
## Compile for Specific Platforms
|
||||
```sh
|
||||
task linux_amd64
|
||||
task linux_amd64_v3
|
||||
```
|
||||
|
||||
## Supported Platforms
|
||||
|
||||
- linux_386
|
||||
- linux_amd64
|
||||
- linux_amd64_v2
|
||||
- linux_amd64_v3
|
||||
- linux_amd64_v4
|
||||
- linux_armv5
|
||||
- linux_armv6
|
||||
- linux_armv7
|
||||
- linux_armv8
|
||||
- linux_mips_hardfloat
|
||||
- linux_mipsle_softfloat
|
||||
- linux_mipsle_hardfloat
|
||||
- linux_mips64
|
||||
- linux_mips64le
|
||||
- windows_386.exe
|
||||
- windows_amd64.exe
|
||||
- windows_amd64_v2.exe
|
||||
- windows_amd64_v3.exe
|
||||
- windows_amd64_v4.exe
|
||||
- darwin_amd64
|
||||
- darwin_arm64
|
||||
@ -1 +1,6 @@
|
||||
...
|
||||
When you need to integrate Bark into your own system or re-implement the backend code, you may need to push certificates.
|
||||
|
||||
##### Valid Until: *Permanent*
|
||||
##### Key ID: *LH4T9V5U4R*
|
||||
##### Team ID: *5U8LBRXG3A*
|
||||
##### Download Link: [AuthKey_LH4T9V5U4R_5U8LBRXG3A.p8](https://github.com/Finb/bark-server/releases/download/v1.0.2/AuthKey_LH4T9V5U4R_5U8LBRXG3A.p8)
|
||||
@ -12,23 +12,63 @@ docker-compose up -d
|
||||
```
|
||||
## Manual Deployment
|
||||
|
||||
1. Download executable files based on operating system platform. <br> <a href='https://github.com/Finb/bark-server/releases'>https://github.com/Finb/bark-server/releases</a><br>
|
||||
Or compile it yourself. <br>
|
||||
1. Download the executable file based on your platform:<br> <a href='https://github.com/Finb/bark-server/releases'>https://github.com/Finb/bark-server/releases</a><br>
|
||||
Or compile it yourself:<br>
|
||||
<a href="https://github.com/Finb/bark-server">https://github.com/Finb/bark-server</a>
|
||||
|
||||
2. Run
|
||||
2. Run the server:
|
||||
```
|
||||
./bark-server_linux_amd64 -addr 0.0.0.0:8080 -data ./bark-data
|
||||
```
|
||||
3. You may need to do
|
||||
3. You may need to make the file executable:
|
||||
```
|
||||
chmod +x bark-server_linux_amd64
|
||||
```
|
||||
Please note that bark-server defaults to using the /data directory to save data. Please make sure that bark-server has permission to read and write the /data directory, or you can use the -data option to specify a directory.
|
||||
Note: The bark-server uses the /data directory by default to store data. Ensure it has read/write permissions or specify a custom directory with the -data option.
|
||||
|
||||
|
||||
## Cloudflare Worker
|
||||
[https://github.com/cwxiaos/bark-worker](https://github.com/cwxiaos/bark-worker)
|
||||
|
||||
## Test
|
||||
```
|
||||
curl http://0.0.0.0:8080/ping
|
||||
```
|
||||
If it returns pong, it means the deployment was successful
|
||||
If it returns pong, the deployment is successful.
|
||||
|
||||
## High-Volume Push Notifications (For regular users, ignore this. Use only if QPS exceeds 3000)
|
||||
If you need to send a large volume of push notifications in a short period, you can configure the bark-server to use multiple APNS Clients for delivery.
|
||||
Each Client represents a new connection (which may connect to different APNs servers). Please set this parameter according to the number of CPU cores. The number of Clients cannot exceed the number of CPU cores (if exceeded, it will automatically be set to the current number of CPU cores).
|
||||
|
||||
#### Docker
|
||||
```
|
||||
docker run -dt --name bark -p 8080:8080 -v `pwd`/bark-data:/data finab/bark-server bark-server --max-apns-client-count 4
|
||||
```
|
||||
|
||||
#### Docker-Compose
|
||||
```yaml
|
||||
version: '3.8'
|
||||
services:
|
||||
bark-server:
|
||||
image: finab/bark-server
|
||||
container_name: bark-server
|
||||
restart: always
|
||||
volumes:
|
||||
- ./data:/data
|
||||
ports:
|
||||
- "8080:8080"
|
||||
command: bark-server --max-apns-client-count 4
|
||||
```
|
||||
|
||||
#### Manual Deployment
|
||||
```
|
||||
./bark-server --addr 0.0.0.0:8080 --data ./bark-data --max-apns-client-count 4
|
||||
```
|
||||
|
||||
|
||||
## 其他
|
||||
|
||||
1. The app sends the <a href="https://developer.apple.com/documentation/uikit/uiapplicationdelegate/1622958-application">DeviceToken</a>to the server.<br>The server sends push requests to Apple’s servers.
|
||||
2. Server code: <a href='https://github.com/Finb/bark-server'>https://github.com/Finb/bark-server</a><br>
|
||||
3. App code: <a href="https://github.com/Finb/Bark">https://github.com/Finb/Bark</a>
|
||||
|
||||
|
||||
@ -19,7 +19,7 @@ Just exit APP when you are on history message page. When you open APP again, it
|
||||
|
||||
#### Does push API support POST request?
|
||||
Bark supports GET POST , supports using Json <br>
|
||||
No matter which request method, parameter names are the same. Refer to [usage tutorial](/tutorial)
|
||||
No matter which request method, parameter names are the same. Refer to [usage tutorial](/en-us/tutorial)
|
||||
|
||||
#### Pushing special characters causes push failure. For example: Push content contains link or Push abnormal such as + becomes space
|
||||
This is because of the problem of irregular link. It often happens<br>
|
||||
|
||||
@ -1 +1,31 @@
|
||||
...
|
||||
#### How Privacy Can Be Leaked <!-- {docsify-ignore-all} -->
|
||||
The route a push notification takes from sending to receiving is as follows:<br>
|
||||
Sender <font color='red'> → Server①</font> → Apple APNS Server → Your Device → <font color='red'>Bark APP②</font>.
|
||||
|
||||
The two red-marked areas are potential points of privacy leakage <br>
|
||||
* The sender does not use HTTPS or uses a public server*(the author can see the request logs)*
|
||||
* The Bark App itself is insecure, and the version uploaded to the App Store has been modified.
|
||||
|
||||
#### Solving Server-Side Privacy Issues
|
||||
* You can use the open-source backend code to [ deploy your own backend service ](/en-us/deploy.md) and enable HTTPS.
|
||||
* Use [encrypted push](/en-us/encryption) with a custom key to encrypt the push content.
|
||||
|
||||
#### Ensuring the App is Completely Built from Open-Source Code
|
||||
To ensure that the App is secure and has not been modified by anyone (including the author), Bark is built by GitHub Actions and then uploaded to the App Store.<br>
|
||||
Within the Bark app settings, you can view the GitHub Run Id. Clicking on it will allow you to find the configuration files used for the current version's build, the source code at compile time, the build number of the version uploaded to the App Store, and more.<br>
|
||||
|
||||
|
||||
The same build number can only be uploaded to the App Store once, making this number unique.<br>
|
||||
You can use this number to compare with the Bark App downloaded from the store. If they match, it proves that the App downloaded from the App Store is completely built from open-source code.
|
||||
|
||||
Example: Bark 1.2.9 - 3 <br>
|
||||
https://github.com/Finb/Bark/actions/runs/3327969456
|
||||
|
||||
1. Find the commit id at compile time to view the complete source code at compile time.
|
||||
2. Check .github/workflows/testflight.yaml to verify all Actions and ensure that the logs printed by the Actions have not been tampered with.
|
||||
3. View Action Logs https://github.com/Finb/Bark/actions/runs/3327969456/jobs/5503414528
|
||||
4. Find the packaged App ID, Team ID, version, and build number uploaded to the App Store, among other information.
|
||||
5. Download the corresponding version ipa from the store and compare whether the build number matches the one in the logs*(this number is unique for the same APP, and once successfully uploaded, it cannot be uploaded again with the same version build number)*
|
||||
|
||||
|
||||
*Here, we do not consider whether iOS leaks privacy.*
|
||||
@ -1 +1,78 @@
|
||||
...
|
||||
## Sending Push Notifications
|
||||
1. Open the APP and copy the test URL.
|
||||
|
||||
<img src="../_media/example.jpg" width=365 />
|
||||
|
||||
2. Modify the content and request this URL.<br>
|
||||
You can send a GET or POST request. If the request is successful, you will receive the push notification immediately.
|
||||
|
||||
## URL Format
|
||||
The URL consists of the push key, parameter title, parameter subtitle, and parameter body. There are three combinations:
|
||||
|
||||
```
|
||||
/:key/:body
|
||||
/:key/:title/:body
|
||||
/:key/:title/:subtitle/:body
|
||||
```
|
||||
|
||||
## Request Methods
|
||||
##### GET request parameters are appended to the URL, for example:
|
||||
```sh
|
||||
curl https://api.day.app/your_key/body?group=groupName©=copyText
|
||||
```
|
||||
*When manually appending parameters to the URL, please pay attention to URL encoding issues.*
|
||||
|
||||
##### POST request parameters are placed in the request body, for example:
|
||||
```sh
|
||||
curl -X POST https://api.day.app/your_key \
|
||||
-d'body=body&group=groupName©=copyText'
|
||||
```
|
||||
##### POST requests support JSON, for example:
|
||||
```sh
|
||||
curl -X "POST" "https://api.day.app/your_key" \
|
||||
-H 'Content-Type: application/json; charset=utf-8' \
|
||||
-d $'{
|
||||
"body": "Test Bark Server",
|
||||
"title": "Test Title",
|
||||
"badge": 1,
|
||||
"sound": "minuet",
|
||||
"icon": "https://day.app/assets/images/avatar.jpg",
|
||||
"group": "test",
|
||||
"url": "https://mritd.com"
|
||||
}'
|
||||
```
|
||||
|
||||
##### JSON request key can be placed in the request body, the URL path must be /push, for example:
|
||||
```sh
|
||||
curl -X "POST" "https://api.day.app/push" \
|
||||
-H 'Content-Type: application/json; charset=utf-8' \
|
||||
-d $'{
|
||||
"body": "Test Bark Server",
|
||||
"title": "Test Title",
|
||||
"device_key": "your_key"
|
||||
}'
|
||||
```
|
||||
|
||||
## Request Parameters
|
||||
List of supported parameters, specific effects can be previewed in the APP.
|
||||
|
||||
| Parameter | Description |
|
||||
| ----- | ----------- |
|
||||
| title | Push title |
|
||||
| subtitle | Push subtitle |
|
||||
| body | Push content |
|
||||
| device_key | Device key |
|
||||
| device_keys | Key array, used for batch push |
|
||||
| level | Push interruption level.<br>critical: Important alert, will ring even in silent mode <br>active:Default value, the system will immediately light up the screen to display the notification<br>timeSensitive:Time-sensitive notification, can display the notification in focus mode.<br>passive:Only adds the notification to the notification list, will not light up the screen. |
|
||||
| volume | Important alert notification volume, value range: 0-10, default is 5 if not passed |
|
||||
| badge | Push badge, can be any number |
|
||||
| call | Pass "1" to repeat the notification ringtone |
|
||||
| autoCopy | Pass "1" to automatically copy the push content on iOS14.5 and below, on iOS14.5 and above, you need to long press or pull down the push to copy |
|
||||
| copy | When copying the push, specify the content to copy, if this parameter is not passed, the entire push content will be copied. |
|
||||
| sound | Can set different ringtones for the push |
|
||||
| icon | Set a custom icon for the push, the set icon will replace the default Bark icon. <br>The icon will be automatically cached on the device, the same icon URL will only be downloaded once. |
|
||||
| group | Group messages, pushes will be displayed in the notification center by group.<br>You can also choose to view different groups in the history message list. |
|
||||
| ciphertext | Ciphertext for encrypted push |
|
||||
| isArchive | Pass 1 to save the push, pass other values to not save the push, if not passed, it will be decided by the APP settings whether to save. |
|
||||
| url | URL to jump to when the push is clicked, supports URL Scheme and Universal Link |
|
||||
| action | Pass "none" to prevent a popup when the push is clicked |
|
||||
@ -15,7 +15,7 @@
|
||||
<script>
|
||||
window.$docsify = {
|
||||
name: 'Bark',
|
||||
nameLink: '/#/?id=源码',
|
||||
nameLink: '/#/en-us/?id=source-code',
|
||||
// repo: 'https://github.com/Finb/Bark',
|
||||
logo: '/_media/Icon.png height=60px',
|
||||
coverpage: true,
|
||||
@ -23,7 +23,7 @@
|
||||
subMaxLevel: 4,
|
||||
loadNavbar: true,
|
||||
auto2top: true,
|
||||
coverpage: ['/', '/en-us/', '/tr/'],
|
||||
coverpage: ['/', '/en-us/'],
|
||||
}
|
||||
</script>
|
||||
<!-- Docsify v4 -->
|
||||
|
||||
@ -1,33 +0,0 @@
|
||||
|
||||
### Bark <!-- {docsify-ignore-all} -->
|
||||
- Ücretsiz, hafif! Kendi iPhone'unuza anlık bildirimler göndermek için arayüzü çağırmanız yeterlidir.
|
||||
- Apple APN'lerine bağlıdır, zamanında, istikrarlı ve güvenilirdir
|
||||
- Cihazın pil gücünü tüketmez. Sistem anlık bildirim hizmeti ve anlık bildirim uzantısına bağlı olarak, APP'nin kendisinin çalışması gerekmez.
|
||||
- Gizlilik ve güvenlik. Yazarın kendisi de dahil olmak üzere hiç kimsenin bazı yollarla gizliliğinizi çalamayacağından emin olabilirsiniz.<br>*[Gizlilik ve güvenliğin](/tr/privacy) nasıl sağlanacağına ilişkin ayrıntılar için tıklayın*
|
||||
|
||||
### Kaynak Kodu
|
||||
- [Bark](https://github.com/Finb/Bark) özel anlık bildirimler almak için tamamen açık kaynaklı bir iOS uygulamasıdır
|
||||
- [bark-server](https://github.com/Finb/bark-server) kullanıcı anlık bildirim isteklerini almak ve bunları Apple APNS'ye iletmek için tamamen açık kaynaklı bir Bark hizmeti arka ucudur.
|
||||
|
||||
### Geri Bildirim
|
||||
- [Telegram Grubu](https://t.me/joinchat/OsCbLzovUAE0YjY1) (Not: gruba katılmak için doğrulamaya tıklayın)
|
||||
- [GitHub Sorunlar](https://github.com/Finb/Bark/issues)
|
||||
|
||||
### Ücretsiz
|
||||
Bark **Temmuz 2018**'de başlatıldı ve en az **Temmuz 2031**'e kadar işletilmeye devam edecek. *("Kalıcı" kelimesini söyleyemem, hala talep varsa daha sonra yenileyelim.)*<br>
|
||||
Uygulama, bakım süresi boyunca herhangi bir şekilde ücretlendirilmeyecek veya reklam içermeyecektir. Kullanmaktan çekinmeyin.
|
||||
|
||||
### Sponsorluk
|
||||
Şu anda yalnızca GitHub sponsorluğunu kabul ediyoruz. Her sponsor için çok teşekkür ederim<br>
|
||||
Sponsorlar:[https://github.com/sponsors/Finb](https://github.com/sponsors/Finb)
|
||||
|
||||
### Dokümantasyon
|
||||
- **Uygulama**
|
||||
- [Öğretici](/tr/tutorial)
|
||||
- [Şifreleme](/tr/encryption)
|
||||
- [SSS](/tr/faq)
|
||||
- **Sunucu**
|
||||
- [Dağıtım](/tr/deploy)
|
||||
- [Oluşturmak](/tr/build)
|
||||
- [Sertifika](/tr/cert)
|
||||
- [Gizlilik](/tr/privacy)
|
||||
@ -1,11 +0,0 @@
|
||||

|
||||
|
||||
# Bark <small></small>
|
||||
|
||||
> Gizlilik odaklı, güvenli ve kontrol edilebilir bir özel anlık bildirim aracı.
|
||||
|
||||
- Ücretsiz, basit ve güvenli
|
||||
- Kullanıma hazır
|
||||
|
||||
[GitHub](https://github.com/finb/bark)
|
||||
[Başlamak](#bark)
|
||||
@ -1,10 +0,0 @@
|
||||
- [Bark](/tr/#bark)
|
||||
- **Uygulama**
|
||||
- [Öğretici](/tr/tutorial)
|
||||
- [Şifreleme](/tr/encryption)
|
||||
- [SSS](/tr/faq)
|
||||
- **Sunucu**
|
||||
- [Dağıtım](/tr/deploy)
|
||||
- [Oluşturmak](/tr/build)
|
||||
- [Sertifika](/tr/cert)
|
||||
- [Gizlilik](/tr/privacy)
|
||||
@ -1,55 +0,0 @@
|
||||
### APNS Arayüzünü Doğrudan Kullanma
|
||||
Eğer cihazınızın DeviceToken'ı varsa (Uygulama içinde bulunabilir), doğrudan Apple APNS arayüzünü çağırarak cihaza anlık bildirim gönderebilirsiniz. Ayrıca, Uygulamaya sunucu eklemeye gerek yoktur.<br>
|
||||
Aşağıda komut satırında anlık bildirim gönderme örneği verilmiştir:
|
||||
|
||||
```shell
|
||||
# Çevresel değişkenleri ayarla
|
||||
# Key'i indir https://raw.githubusercontent.com/Finb/bark-server/master/deploy/AuthKey_LH4T9V5U4R_5U8LBRXG3A.p8
|
||||
# Key dosyasının yolunu aşağıya gir
|
||||
TOKEN_KEY_FILE_NAME=
|
||||
# Uygulama ayarlarından kopyalanan DeviceToken'ı buraya yapıştır
|
||||
DEVICE_TOKEN=
|
||||
|
||||
# Aşağıdakileri değiştirmeyin !!!
|
||||
TEAM_ID=5U8LBRXG3A
|
||||
AUTH_KEY_ID=LH4T9V5U4R
|
||||
TOPIC=me.fin.bark
|
||||
APNS_HOST_NAME=api.push.apple.com
|
||||
|
||||
# TOKEN oluştur
|
||||
JWT_ISSUE_TIME=$(date +%s)
|
||||
JWT_HEADER=$(printf '{ "alg": "ES256", "kid": "%s" }' "${AUTH_KEY_ID}" | openssl base64 -e -A | tr -- '+/' '-_' | tr -d =)
|
||||
JWT_CLAIMS=$(printf '{ "iss": "%s", "iat": %d }' "${TEAM_ID}" "${JWT_ISSUE_TIME}" | openssl base64 -e -A | tr -- '+/' '-_' | tr -d =)
|
||||
JWT_HEADER_CLAIMS="${JWT_HEADER}.${JWT_CLAIMS}"
|
||||
JWT_SIGNED_HEADER_CLAIMS=$(printf "${JWT_HEADER_CLAIMS}" | openssl dgst -binary -sha256 -sign "${TOKEN_KEY_FILE_NAME}" | openssl base64 -e -A | tr -- '+/' '-_' | tr -d =)
|
||||
# Eğer koşullar elverişliyse, en iyi performans için bu betiği geliştirerek TOKEN'ı önbelleğe almanız iyi olur.
|
||||
# Aynı TOKEN'i 30 dakika içinde tekrar kullanmak, her 30 dakikada bir yeniden oluşturmaktan daha iyidir.
|
||||
# Apple dokümantasyonu, TOKEN'ın en erken 20 dakika arayla yeniden oluşturulabileceğini belirtmektedir. TOKEN'ın maksimum geçerlilik süresi 60 dakikadır.
|
||||
# Ancak, sık sık yeniden oluşturmak TOKEN'ın başarısız olmasına neden olabilir.
|
||||
# Bu bilgiyi paylaşmak istiyoruz, belki sık sık TOKEN oluşturmak nedeniyle anlık bildirim gönderiminde sorun yaşanabilir.
|
||||
AUTHENTICATION_TOKEN="${JWT_HEADER}.${JWT_CLAIMS}.${JWT_SIGNED_HEADER_CLAIMS}"
|
||||
|
||||
# Anlık bildirim gönderme
|
||||
curl -v --header "apns-topic: $TOPIC" --header "apns-push-type: alert" --header "authorization: bearer $AUTHENTICATION_TOKEN" --data '{"aps":{"alert":"test"}}' --http2 https://${APNS_HOST_NAME}/3/device/${DEVICE_TOKEN}
|
||||
|
||||
```
|
||||
|
||||
### Push Parametre Formatı
|
||||
Bknz. https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/generating_a_remote_notification<br>
|
||||
"mutable-content" : 1 getirdiğinizden emin olun, aksi takdirde anlık bildirim uzantısı çalışmayacak ve anlık bildirimi kaydetmeyecektir.
|
||||
|
||||
Örnek:
|
||||
```js
|
||||
{
|
||||
"aps": {
|
||||
"mutable-content": 1,
|
||||
"alert": {
|
||||
"title" : "Başlık",
|
||||
"body": "İçerik"
|
||||
},
|
||||
"category": "myNotificationCategory",
|
||||
"sound": "minuet.caf"
|
||||
},
|
||||
"icon": "https://day.app/assets/images/avatar.jpg"
|
||||
}
|
||||
```
|
||||
@ -1,47 +0,0 @@
|
||||
## Kaynak Kodu İndirme
|
||||
GitHub'dan kaynak kodunu indirin: [bark-server](https://github.com/Finb/bark-server)
|
||||
|
||||
veya
|
||||
```sh
|
||||
git clone https://github.com/Finb/bark-server.git
|
||||
```
|
||||
## Gerekli Bağımlılıkları Yapılandırma
|
||||
- Golang 1.18+
|
||||
- Go Mod (env GO111MODULE=on)
|
||||
- Go Mod Proxy (env GOPROXY=https://goproxy.cn)
|
||||
- [go-task](https://taskfile.dev/installation/) kurulu olmalı.
|
||||
|
||||
## Tüm Platformlar İçin Çapraz Derleme
|
||||
```sh
|
||||
task
|
||||
```
|
||||
|
||||
## Belirli Bir Platform İçin Derleme
|
||||
```sh
|
||||
task linux_amd64
|
||||
task linux_amd64_v3
|
||||
```
|
||||
|
||||
## Desteklenen Platformlar
|
||||
|
||||
- linux_386
|
||||
- linux_amd64
|
||||
- linux_amd64_v2
|
||||
- linux_amd64_v3
|
||||
- linux_amd64_v4
|
||||
- linux_armv5
|
||||
- linux_armv6
|
||||
- linux_armv7
|
||||
- linux_armv8
|
||||
- linux_mips_hardfloat
|
||||
- linux_mipsle_softfloat
|
||||
- linux_mipsle_hardfloat
|
||||
- linux_mips64
|
||||
- linux_mips64le
|
||||
- windows_386.exe
|
||||
- windows_amd64.exe
|
||||
- windows_amd64_v2.exe
|
||||
- windows_amd64_v3.exe
|
||||
- windows_amd64_v4.exe
|
||||
- darwin_amd64
|
||||
- darwin_arm64
|
||||
@ -1,6 +0,0 @@
|
||||
Bark'ı kendi sistemine entegre etmeniz veya arka uç kodunu yeniden uygulamanız gerektiğinde, anlık bildirim sertifikasına ihtiyacınız olabilir.
|
||||
|
||||
##### Geçerlilik Süresi: *Süresiz*
|
||||
##### Anahtar Kimliği (Key ID):*LH4T9V5U4R*
|
||||
##### Ekip Kimliği (TeamID):*5U8LBRXG3A*
|
||||
##### İndirme Bağlantısı:[AuthKey_LH4T9V5U4R_5U8LBRXG3A.p8](https://github.com/Finb/bark-server/releases/download/v1.0.2/AuthKey_LH4T9V5U4R_5U8LBRXG3A.p8)
|
||||
@ -1,86 +0,0 @@
|
||||
|
||||
## Docker
|
||||
```
|
||||
docker run -dt --name bark -p 8080:8080 -v `pwd`/bark-data:/data finab/bark-server
|
||||
```
|
||||
|
||||
## Docker-Compose
|
||||
```
|
||||
mkdir bark && cd bark
|
||||
curl -sL https://git.io/JvSRl > docker-compose.yaml
|
||||
docker-compose up -d
|
||||
```
|
||||
## Manuel Dağıtım
|
||||
|
||||
1. Platforma göre çalıştırılabilir dosyayı indirin.<br> <a href='https://github.com/Finb/bark-server/releases'>https://github.com/Finb/bark-server/releases</a><br>
|
||||
veya kendiniz derleyin<br>
|
||||
<a href="https://github.com/Finb/bark-server">https://github.com/Finb/bark-server</a>
|
||||
|
||||
2. Çalıştırın
|
||||
```
|
||||
./bark-server_linux_amd64 -addr 0.0.0.0:8080 -data ./bark-data
|
||||
```
|
||||
3. Gerekebilir
|
||||
```
|
||||
chmod +x bark-server_linux_amd64
|
||||
```
|
||||
Lütfen unutmayın ki bark-server varsayılan olarak verileri saklamak için /data dizinini kullanır. Bark-server'ın /data dizinine okuma ve yazma izinlerine sahip olduğundan emin olun veya farklı bir dizini belirtmek için `-data` seçeneğini kullanabilirsiniz.
|
||||
|
||||
## Sunucusuz Mimari (Serverless)
|
||||
|
||||
|
||||
Heroku ücretsiz dağıtım sunar (2022-11-28 tarihine kadar).<br>
|
||||
[](https://heroku.com/deploy?template=https://github.com/finb/bark-server)<br>
|
||||
|
||||
Web yönlendirmelerini destekleyen diğer serverless sunucuları, Serverless modunu etkinleştirmek için `bark-server -serverless true` komutunu kullanabilirsiniz.
|
||||
|
||||
Etkinleştirildiğinde, bark-server sistem ortam değişkenleri BARK_KEY ve BARK_DEVICE_TOKEN'ı okuyacaktır. Bu değerleri önceden ayarlamanız gerekmektedir.
|
||||
|
||||
| Değişken Adı | Gereksinimler |
|
||||
| ---- | ---- |
|
||||
| BARK_KEY | "push" dışında herhangi bir değer girilebilir. |
|
||||
| BARK_DEVICE_TOKEN | Bark App ayarlarında görünen DeviceToken. Bu Token gerçek APNS cihaz tokenidir, lütfen sızdırmayın. |
|
||||
|
||||
Lütfen Serverless modunun yalnızca bir cihaza izin verdiğini unutmayın.
|
||||
|
||||
## Render
|
||||
Render, ücretsiz bir bark-server oluşturmayı çok kolay hale getirir.
|
||||
1. [Render](https://dashboard.render.com/register/) hesabı oluşturun.
|
||||
2. [Yeni Web Hizmeti](https://dashboard.render.com/select-repo?type=web) oluşturun.
|
||||
3. Aşağıdaki URL'yi **Public Git repository** giriş kutusuna girin
|
||||
```
|
||||
https://github.com/Finb/bark-server
|
||||
```
|
||||
4. **Devam et**'i tıklayın ve formu doldurun
|
||||
* **Name** - Ad, herhangi bir ad seçin, örneğin bark-server.
|
||||
* **Region** - Sunucu bölgesi, size en yakın olanı seçin.
|
||||
* **Start Command** - Programı çalıştırma komutu, `./app -serverless true` şeklinde doldurun. (Lütfen ./app öncesindeki noktayı unutmayın)
|
||||
* **Instance Type** - *Free*'yi seçin, ücretsiz olan yeterlidir.
|
||||
* Seçenekleri genişletmek için **Advanced**'e tıklayın.
|
||||
* **Add Environment Variable**'a tıklayarak Serverless modu için gereken BARK_KEY ve BARK_DEVICE_TOKEN alanlarını ekleyin. (Gereksinimler için [Serverless](#Serverless) bölümüne bakın) <br><img src="_media/environment.png" />
|
||||
* Diğer seçenekler değiştirilmez
|
||||
5. Sayfanın alt kısmında **Create Web Service** düğmesine tıklayın ve durumun **In progress**'ten **Live**'a geçmesini bekleyin, bu birkaç dakika ila on dakika sürebilir.
|
||||
6. Sayfanın üst kısmında sunucu URL'nizi bulun, bu bark-server sunucu URL'si, Bark App'e ekleyebilirsiniz
|
||||
```
|
||||
https://[sizin-sunucu-adiniz].onrender.com
|
||||
```
|
||||
7. Sunucu ekleme başarısız olursa bir süre bekleyebilir ve tekrar deneyebilirsiniz. Servis henüz hazır olmayabilir.
|
||||
8. Bark App'e ekleme yapmanıza gerek yoktur, doğrudan çağrı yaparak anlık bildirim gönderebilirsiniz. BARK_KEY yukarıda doldurduğunuz anahtardır.
|
||||
```
|
||||
https://[sizin-sunucu-adiniz].onrender.com/BARK_KEY/推送内容
|
||||
```
|
||||
|
||||
## Test
|
||||
```
|
||||
curl http://0.0.0.0:8080/ping
|
||||
```
|
||||
Eğer **pong** dönerse, dağıtım başarılı demektir.
|
||||
|
||||
## Diğer
|
||||
|
||||
1. Uygulama tarafı sunucu tarafına <a href="https://developer.apple.com/documentation/uikit/uiapplicationdelegate/1622958-application">DeviceToken</a>göndermekten sorumludur.<br>Sunucu tarafı bir push isteği aldığında, Apple sunucusuna bir anlık bildirim gönderir. Ardından cep telefonu anlık bildirimi alır.
|
||||
|
||||
2. Sunucu kodu:<a href='https://github.com/Finb/bark-server'>https://github.com/Finb/bark-server</a><br>
|
||||
|
||||
3. Uygulama Kodu: <a href="https://github.com/Finb/Bark">https://github.com/Finb/Bark</a>
|
||||
|
||||
@ -1,36 +0,0 @@
|
||||
#### Anlık Bildirim şifreleme nedir?
|
||||
Anlık bildirim şifreleme, Anlık bildirim içeriğini korumak için bir yöntemdir ve gönderme ve alma sırasında Anlık bildirim içeriğini şifrelemek ve şifresini çözmek için özel bir anahtar kullanır. Bu şekilde, Anlık bildirim içeriği iletim sırasında Bark sunucusu ve Apple APNs sunucusu tarafından elde edilemez veya sızdırılamaz.
|
||||
|
||||
#### Özel anahtar ayarlama
|
||||
1. Uygulama ana sayfasını açın.
|
||||
2. "Anlık Bildirim Şifreleme"yi bulun, Şifreleme Ayarları'na tıklayın.
|
||||
3. Şifreleme algoritmasını seçin, ANAHTARI gerektiği gibi doldurun, özel anahtarı kaydetmek için Bitti'ye tıklayın.
|
||||
|
||||
#### Şifreli anlık bildirim gönderme
|
||||
Şifrelenmiş bir anlık bildirim göndermek için önce Bark istek parametrelerini json formatında bir dizeye dönüştürmeniz, ardından dizeyi şifrelemek için önceden ayarlanmış anahtarı ve ilgili algoritmayı kullanmanız ve son olarak şifrelenmiş şifre metnini sunucuya "ciphertext" parametresi olarak göndermeniz gerekir.<br><br>
|
||||
**Örneğin:**
|
||||
```sh
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
# bark anahtarı
|
||||
deviceKey='F5u42Bd3HyW8KxkUqo2gRA'
|
||||
# anlık bildirim gönderilen veri
|
||||
json='{"body": "test", "sound": "birdsong"}'
|
||||
|
||||
# 16 bit uzunluğunda olmalıdır
|
||||
key='1234567890123456'
|
||||
iv='1111111111111111'
|
||||
|
||||
# openssl, manuel anahtarların ve IV'lerin ASCII kodlamasını değil, Hex kodlamasını gerektirir.
|
||||
key=$(printf $key | xxd -ps -c 200)
|
||||
iv=$(printf $iv | xxd -ps -c 200)
|
||||
|
||||
ciphertext=$(echo -n $json | openssl enc -aes-128-cbc -K $key -iv $iv | base64)
|
||||
|
||||
# Konsol şunları yazdıracaktır "d3QhjQjP5majvNt5CjsvFWwqqj2gKl96RFj5OO+u6ynTt7lkyigDYNA3abnnCLpr"
|
||||
echo $ciphertext
|
||||
|
||||
curl --data-urlencode "ciphertext=$ciphertext" http://api.day.app/$deviceKey
|
||||
```
|
||||
@ -1,46 +0,0 @@
|
||||
#### Anlık bildirim kullanım limiti <!-- {docsify-ignore-all} -->
|
||||
Normal isteklerin (HTTP durum kodu 200) sınırı yoktur.<br>
|
||||
Ancak 5 dakika içinde 1000'den fazla hata isteği (HTTP durum kodu 400 404 500) yapılırsa, <b>IP 24 saat boyunca YASAKLANACAKTIR.</b>
|
||||
|
||||
#### Zamana duyarlı bildirimler çalışmıyor
|
||||
Sorunu çözmek için <b>cihazınızı yeniden başlatmayı</b> deneyebilirsiniz.
|
||||
|
||||
#### Bildirim geçmişi kaydedilemiyor veya kopyala düğmesine tıklamadan kilit ekranında aşağı iterek veya sola kaydırarak kopyalanamıyor
|
||||
Sorunu çözmek için <b>cihazınızı yeniden başlatmayı</b> deneyebilirsiniz.<br />
|
||||
Bazı nedenlerden dolayı, anlık bildirim hizmeti uzantısı ([UNNotificationServiceExtension](https://developer.apple.com/documentation/usernotifications/unnotificationserviceextension)) düzgün bir şekilde çalıştırılamadı ve bildirimleri kaydetme kodu düzgün bir şekilde yürütülmedi.
|
||||
|
||||
#### Otomatik kopyalama anlık bildirim hatası
|
||||
iOS 14.5 sürümünden sonra, izinlerin sıkılaştırılması nedeniyle, push bildirimi alırken içeriği otomatik olarak panoya kopyalamak mümkün değildir. <br/>
|
||||
Geçici olarak push bildirimini aşağı çekebilir veya ekran kilidinde sola kaydırarak görüntüleyip otomatik olarak kopyalayabilirsiniz, veya açılır penceredeki kopyala düğmesine tıklayabilirsiniz.
|
||||
|
||||
#### Bildirim geçmişi sayfasını varsayılan olarak aç
|
||||
Uygulamayı tekrar açtığınızda, son açılan sayfaya atlayacaktır.<br />
|
||||
Eğer geçmiş mesaj sayfasındaysanız, uygulamadan çıkın. Uygulamayı tekrar açtığınızda yine geçmiş mesaj sayfasında olacaksınız.
|
||||
|
||||
#### Anlık Bildirim API POST isteğini destekliyor mu?
|
||||
Bark GET POST'u destekler, Json kullanımını destekler.<br>
|
||||
Hangi istek yöntemi olursa olsun, parametre adları aynıdır. Bakınız [kullanım öğreticisi](tr/tutorial)
|
||||
|
||||
#### Özel karakterler anlık bildirim işleminde başarısızlığa neden oluyor. Örneğin: İtme içeriği bağlantı içeriyor veya + gibi özel karakterler boşluğa dönüşüyor.
|
||||
Bunun nedeni düzensiz bağlantı sorunudur. Sıklıkla olur<br>
|
||||
URL eklerken, URL kodlama parametrelerine dikkat edin
|
||||
|
||||
```sh
|
||||
# Örneğin
|
||||
https://api.day.app/key/{push content}
|
||||
|
||||
# Eğer {anlık bildirim içeriği} ise
|
||||
"a/b/c/"
|
||||
|
||||
# O zaman URLnin son durumu şöyledir
|
||||
https://api.day.app/key/a/b/c/
|
||||
# İlgili rota bulunamaz ve arka uç programı 404 döndürür
|
||||
|
||||
#Eklemeden önce {anlık bildirim içeriği} öğesini url kodlamalısınız
|
||||
https://api.day.app/key/a%2Fb%2Fc%2F
|
||||
```
|
||||
Gelişmiş bir HTTP kütüphanesi kullanırsanız, parametreler otomatik olarak işlenecek ve manuel kodlamaya ihtiyaç duymayacaksınız. <br>
|
||||
Ancak URL'yi kendiniz eklerseniz, parametrelerdeki özel karakterler için özel dikkat göstermeniz gerekir. **Özel karakterlerin varlığını dikkate almadan ve otomatik olarak URL kodlama katmanı uygulamak genellikle daha iyi bir yaklaşımdır.**
|
||||
|
||||
#### Gizlilik ve güvenlik nasıl sağlanır?
|
||||
Bakınız [gizlilik güvenlik](/tr/privacy)
|
||||
@ -1,31 +0,0 @@
|
||||
#### Gizlilik Nasıl Sızdırılır? <!-- {docsify-ignore-all} -->
|
||||
Bir anlık bildirimin gönderilmesinden alınmasına kadar geçtiği yol şöyledir:<br />
|
||||
Gönderici<font color='red'> → Sunucu①</font> → Apple APNS sunucusu → Aygıtınız → <font color='red'>Bark Uygulaması②</font>。
|
||||
|
||||
Kırmızıyla işaretlenen bu iki yerde gizlilik sızdırma riski olabilir:<br>
|
||||
* Gönderen HTTPS kullanmıyor veya herkese açık bir sunucu kullanıyor (yazarlar istek günlüklerini görecektir)
|
||||
* Bark Uygulaması kendisi güvenli değilse, App Store'a yüklenen sürümde değişiklikler yapılmış olabilir.
|
||||
|
||||
#### Sunucu Gizlilik Sorununu Nasıl Çözebilirsiniz
|
||||
* Açık kaynaklı sunucu kodunu kullanarak [kendi sunucunuzu kurarak](/tr/deploy.md) ve HTTPS'yi etkinleştirerek.
|
||||
* [Şifreli Push Bildirimi](/tr/encryption) kullanarak, içerikleri şifreleyebilirsiniz.
|
||||
|
||||
#### Uygulamanın Tamamen Açık Kaynak Kodlarla İnşa Edildiğini Sağlama
|
||||
Uygulamanın güvenli olmasını ve hiç kimse tarafından (yazar dahil) değiştirilmemesini sağlamak için Bark, GitHub Actions tarafından oluşturulur ve ardından App Store'a yüklenir.<br />
|
||||
GitHub Çalıştırma Kimliği, Bark uygulama ayarlarında bulunabilir; burada derlemenin geçerli sürümü için kullanılan yapılandırma dosyası, derlemede kullanılan kaynak kodu, App Store'a yüklenen sürümün derleme numarası ve daha fazlası hakkında bilgi bulabilirsiniz.<br>
|
||||
|
||||
|
||||
Aynı derleme numarası App Store'a yalnızca bir kez yüklenebilir, bu nedenle benzersizdir.<br>
|
||||
Bu numarayı, Mağazadan indirilen Bark Uygulamalarını karşılaştırmak için kullanabilirsiniz ve eşleşirse, App Store'dan indirilen Uygulamanın tamamen açık kaynak kodundan oluşturulduğunu kanıtlar.
|
||||
|
||||
Örnek: Bark 1.2.9 - 3<br>
|
||||
https://github.com/Finb/Bark/actions/runs/3327969456
|
||||
|
||||
1. Derleme sırasındaki commit kimliğini bulun ve derleme sırasında kullanılan kaynak kodlarını görüntüleyin.
|
||||
2. .github/workflows/testflight.yaml dosyasını inceleyin, tüm işlemleri doğrulayın ve bu işlemlerin kayıtlarının değiştirilmediğinden emin olun.
|
||||
3. Action Günlüklerini görüntüleyin: https://github.com/Finb/Bark/actions/runs/3327969456/jobs/5503414528
|
||||
4. Paketlenen Uygulama Kimliği (App ID), Ekip Kimliği (Team ID), App Store'a yüklenen sürüm ve derleme numarası gibi bilgileri bulun.
|
||||
5. Mağaza için ilgili sürümün IPA dosyasını indirin ve derleme numarasını kayıtlardakiyle karşılaştırın *(Bu numara her uygulama için benzersizdir ve bir kez yüklendikten sonra aynı derleme numarasıyla başka bir sürüm yüklenemez)*.
|
||||
|
||||
|
||||
*Bu kapsamda iOS'un gizlilik açısından incelenmesi dikkate alınmamıştır*
|
||||
@ -1,70 +0,0 @@
|
||||
## Anlık Bildirim Gönderimi
|
||||
1. Uygulamayı açın, test URL'sini kopyalayın.
|
||||
|
||||
<img src="_media/example.jpg" width=365 />
|
||||
|
||||
2. İçeriği değiştirin ve URL'ye istek atın.<br>
|
||||
GET veya POST isteği gönderebilirsiniz, istek başarılıysa hemen bir push alacaksınız.
|
||||
|
||||
## URL Formatı
|
||||
URL, bir anlık bildirim anahtarı, "title" parametresi ve "body" parametresinden oluşur. İki farklı kombinasyon şekli vardır:
|
||||
|
||||
```
|
||||
/:key/:body
|
||||
/:key/:title/:body
|
||||
```
|
||||
|
||||
## İstek Yöntemi
|
||||
##### GET isteği parametreleri URL'nin sonuna eklenir, örneğin:
|
||||
```sh
|
||||
curl https://api.day.app/your_key/BildirimIcerigi?group=Grup©=KopyalanacakIcerik
|
||||
```
|
||||
*Elle parametreleri URL'ye eklerken URL kodlama sorunlarına dikkat etmelisiniz, [Sıkça Sorulan Sorular: URL Kodlama](tr/faq?id=%C3%96zel-karakterler-anl%C4%B1k-bildirim-i%C5%9Fleminde-ba%C5%9Far%C4%B1s%C4%B1zl%C4%B1%C4%9Fa-neden-oluyor-%C3%96rne%C4%9Fin-%C4%B0tme-i%C3%A7eri%C4%9Fi-ba%C4%9Flant%C4%B1-i%C3%A7eriyor-veya-gibi-%C3%B6zel-karakterler-bo%C5%9Flu%C4%9Fa-d%C3%B6n%C3%BC%C5%9F%C3%BCyor)*
|
||||
|
||||
##### POST isteği parametreleri istek gövdesine yerleştirilir, örneğin:
|
||||
```sh
|
||||
curl -X POST https://api.day.app/your_key \
|
||||
-d'body=Push İçeriği&group=Grup©=Kopyala'
|
||||
```
|
||||
##### POST isteği JSON'ı destekler, örneğin:
|
||||
```sh
|
||||
curl -X "POST" "https://api.day.app/your_key" \
|
||||
-H 'Content-Type: application/json; charset=utf-8' \
|
||||
-d $'{
|
||||
"body": "Test Bark Server",
|
||||
"title": "Test Başlık",
|
||||
"badge": 1,
|
||||
"sound": "minuet.caf",
|
||||
"icon": "https://day.app/assets/images/avatar.jpg",
|
||||
"group": "test",
|
||||
"url": "https://mritd.com"
|
||||
}'
|
||||
```
|
||||
|
||||
##### JSON isteği anahtarı istek gövdesine yerleştirilebilir, URL yolu */push* olmalıdır, örneğin
|
||||
```sh
|
||||
curl -X "POST" "https://api.day.app/push" \
|
||||
-H 'Content-Type: application/json; charset=utf-8' \
|
||||
-d $'{
|
||||
"body": "Test Bark Server",
|
||||
"title": "Test Başlık",
|
||||
"device_key": "sizin_anahtarınız"
|
||||
}'
|
||||
```
|
||||
|
||||
## İstek Parametreleri
|
||||
Desteklenen parametrelerin listesi, belirli bir etkiyi uygulamada nasıl görüneceğini görmek için uygulama içinden önizleme yapabilirsiniz.
|
||||
|
||||
| Parametre | Açıklama |
|
||||
| ----- | ----------- |
|
||||
| title | Anlık bildirim başlığı |
|
||||
| body | Anlık bildirim içeriği |
|
||||
| level | Anlık bildirim kesme seviyesi. <br>**active:** Varsayılan değer, sistem bildirimi hemen göstermek için ekranı aydınlatacaktır.<br>**timeSensitive:** Zamana duyarlı bildirim, odaklanmış durumda bildirim gösterebilir.<br>**passive:** Bildirimi yalnızca bildirim listesine ekler, hatırlatmak için ekranı aydınlatmaz. |
|
||||
| badge | Anlık bildirim rozeti, herhangi bir sayı olabilir. |
|
||||
| autoCopy | iOS 14.5'ten önce otomatik olarak anlık bildirim içeriğini kopyalar, iOS 14.5'ten sonraysa manuel olarak uzun basmalı veya anlık bildirim aşağı çekilmelidir |
|
||||
| copy | Bir anlık bildirim kopyalanırken, kopyalanacak içeriği belirtin; bu parametre belirtilmezse tüm anlık bildirim içeriğini kopyalar. |
|
||||
| sound | Anlık bildirim için bir ses seçebilirsiniz. |
|
||||
| icon | Anlık bildirim için özel bir simge ayarlayın ve ayarlanan simge varsayılan Bark simgesinin yerini alacaktır. Simgeler otomatik olarak yerel olarak önbelleğe alınır ve aynı simge URL'si yalnızca bir kez indirilir. |
|
||||
| group | Bildirimleri gruplandırın, anlık bildirimler gruplanmış bir şekilde bildirim merkezinde görüntülenir.<br>Ayrıca geçmiş mesajlar listesinde farklı grupları görüntülemeyi de seçebilirsiniz. |
|
||||
| isArchive | 1 ile gönderirseniz, anlık bildirim kaydedilir; diğer bir değer gönderirseniz kaydedilmez. Göndermezseniz, kaydetme ayarlarına göre karar verilir. |
|
||||
| url | Anlık bildirime tıklanınca gidilecek URL, URL Şeması ve Evrensel Bağlantıları destekler. |
|
||||
@ -35,7 +35,7 @@ curl -X "POST" "https://api.day.app/your_key" \
|
||||
"body": "Test Bark Server",
|
||||
"title": "Test Title",
|
||||
"badge": 1,
|
||||
"sound": "minuet.caf",
|
||||
"sound": "minuet",
|
||||
"icon": "https://day.app/assets/images/avatar.jpg",
|
||||
"group": "test",
|
||||
"url": "https://mritd.com"
|
||||
@ -61,16 +61,18 @@ curl -X "POST" "https://api.day.app/push" \
|
||||
| title | 推送标题 |
|
||||
| subtitle | 推送副标题 |
|
||||
| body | 推送内容 |
|
||||
| level | 推送中断级别。 <br>active:默认值,系统会立即亮屏显示通知<br>timeSensitive:时效性通知,可在专注状态下显示通知。<br>passive:仅将通知添加到通知列表,不会亮屏提醒。 |
|
||||
| device_key | 设备key |
|
||||
| device_keys | key 数组,用于批量推送 |
|
||||
| level | 推送中断级别。<br>critical: 重要警告, 在静音模式下也会响铃 <br>active:默认值,系统会立即亮屏显示通知<br>timeSensitive:时效性通知,可在专注状态下显示通知。<br>passive:仅将通知添加到通知列表,不会亮屏提醒。 |
|
||||
| volume | 重要警告的通知音量,取值范围:0-10,不传默认值为5 |
|
||||
| badge | 推送角标,可以是任意数字 |
|
||||
| autoCopy | iOS14.5以下自动复制推送内容,iOS14.5以上需手动长按推送或下拉推送 |
|
||||
| call | 传"1"时,通知铃声重复播放 |
|
||||
| autoCopy | 传"1"时, iOS14.5以下自动复制推送内容,iOS14.5以上需手动长按推送或下拉推送 |
|
||||
| copy | 复制推送时,指定复制的内容,不传此参数将复制整个推送内容。 |
|
||||
| sound | 可以为推送设置不同的铃声 |
|
||||
| call | 通知铃声重复播放 |
|
||||
| icon | 为推送设置自定义图标,设置的图标将替换默认Bark图标。<br>图标会自动缓存在本机,相同的图标 URL 仅下载一次。 |
|
||||
| group | 对消息进行分组,推送将按group分组显示在通知中心中。<br>也可在历史消息列表中选择查看不同的群组。 |
|
||||
| ciphertext | 推送加密 |
|
||||
| level | 重要警告、时效性通知、静默通知 |
|
||||
| volume | 重要警告的通知音量,可不传 |
|
||||
| ciphertext | 加密推送的密文 |
|
||||
| isArchive | 传 1 保存推送,传其他的不保存推送,不传按APP内设置来决定是否保存。 |
|
||||
| url | 点击推送时,跳转的URL ,支持URL Scheme 和 Universal Link |
|
||||
| url | 点击推送时,跳转的URL ,支持URL Scheme 和 Universal Link |
|
||||
| action | 传 "none" 时,点击推送不会弹窗 |
|
||||
Loading…
x
Reference in New Issue
Block a user