-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 0bd6eb3
Showing
182 changed files
with
27,012 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
name: Bug report | ||
about: Report an issue with the SDK | ||
title: '' | ||
labels: bug | ||
assignees: '' | ||
|
||
--- | ||
|
||
<!-- Thank you for using Batch and taking the time to file an issue! | ||
Please only file issues here that you believe represent actual bugs for the Batch iOS SDK. | ||
If you're having general trouble with your Batch integration, reach out to our support team at [email protected] or via the Live-Chat, available on every page of the Batch dashboard. It’s the best way to make sure your question is handled by the right person in our team and in timely manners. | ||
Otherwise, to make it easier to diagnose your issue, please fill out the following template. | ||
Depending on your plan, you way benefit from a specific support level. In that case (e.g. you're an Enterprise or Business customer) and to make sure your support level is respected, send an email that links your issue to the [email protected] address. | ||
--> | ||
|
||
## Summary | ||
<!-- A summary of the problems you're having. Please state clearly expected and actual behavior. --> | ||
|
||
## Reproduction steps | ||
<!-- Provide detailed reproduction steps. For example : | ||
1. Setup the SDK tag | ||
2. Send a test notification | ||
3. Open the test notification | ||
A minimal reproduction project isn’t compulsory but will reduce greatly the resolution time, and we may ask you to provide one depending on the issue. | ||
--> | ||
|
||
## Logs | ||
<!-- Please don’t try filter the logs here, it’s best to provide here the rawest logs as possible. If your issue involves a crash, a stack trace is absolutely compulsory, and should be as raw as possible. If you would rather not share the logs publicly, forward them to the [email protected] address and reference the URL of your issue. --> | ||
|
||
## Specifications | ||
### SDK Version | ||
<!-- e.g. v3 --> | ||
### Setup method | ||
<!-- e.g. Using Google Tag Manager --> | ||
### Relevant development tools versions | ||
<!-- e.g. Firefox version --> | ||
|
||
## Additional information | ||
<!-- Anything else you can include that'll make it easier for us to help you! --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
blank_issues_enabled: false | ||
contact_links: | ||
- name: Batch Support | ||
url: https://batch.com/en/support/ | ||
about: Reach our support team via email or Live-Chat. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<!-- We don’t accept pull requests at the moment. Please reach out to our support team at [email protected] or via the Live-Chat, or open an issue. --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
.DS_Store | ||
*.swp | ||
*.orig | ||
build/*.js | ||
build/*.map | ||
doc/ | ||
web-api-reference/ | ||
node_modules | ||
npm-debug.log | ||
yarn-error.log | ||
tmpdeploy/ | ||
eslint_report.json | ||
.coverage-report/ | ||
|
||
# Yarn | ||
.yarn/* | ||
#!.yarn/cache | ||
!.yarn/releases | ||
!.yarn/plugins |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Building Batch SDK | ||
|
||
## Requirements | ||
|
||
- Node 17+ | ||
- Yarn | ||
|
||
## Steps | ||
|
||
- Run `yarn` | ||
- Run `yarn build` | ||
|
||
See package.json for all available scripts. | ||
|
||
## Deployment | ||
|
||
Using this on your website will require you to edit the "static" URL of "webpack.hosts.config.js" and replicate the same structure as Batch's on your servers. | ||
|
||
Assuming that you're trying to deploy version 3.3.0, the following URLs have to be present: | ||
|
||
- https://<yourhost>/v3/bootstrap.min.js | ||
- https://<yourhost>/v3/worker.min.js | ||
- https://<yourhost>/3.3.0/sdk.min.js | ||
- Any file present in the build/ folder should be in this folder | ||
- Any file present in resources/ should also be in this folder | ||
- https://<yourhost>/manifest.json (download our manifest to see the expected format, or modify the bootstrap code) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
Batch is a project administrated by the Batch.com team. Thank you for your interest to contribute! 🙏 | ||
|
||
# Closed development & public releases | ||
While the Batch SDK' sources are publicly available on this repo, we develop the SDK privately, and only push releases on here. All commits from our team won’t be visible publicly for now. | ||
# Integration questions | ||
If you encounter any issue during your integrations, you are most likely to find an answer in: | ||
- Our [public documentation](https://doc.batch.com/) | ||
- Our [help center](https://help.batch.com/en/) | ||
|
||
Both of these ressources are updated regularly and cover many troubleshooting options. | ||
|
||
If you’re still blocked, please reach out to our support team at [email protected] or via the Live-Chat, available on every page of the Batch dashboard. It’s the best way to make sure your question is handled by the right person in our team and in timely manners. It will also allow you to share more context you would rather not share publicly. For example, information about your account and plan, and most importantly debug information (as identifiers). | ||
|
||
If you submit an issue to discuss an integration question, we will ask you to use these communication channels for these reasons. | ||
|
||
# Feature & improvement requests | ||
We look at all feature requests with great interest, and they will be be balanced with our own internal roadmap. | ||
|
||
More often than not, feature requests regarding Batch SDK will actually concern the Batch product as a whole (if you’re already a client, you may know our dashboard or APIs for example). We also have internal processes to qualify and process your feedbacks that can include user interview, or need broader context on your needs. | ||
|
||
Even if you’re confident that your feature requests relies only in the scope of the SDK we still ask you to submit your request at the [email protected] address for tracking purposes. | ||
|
||
# Bug fixes | ||
If you think you've discovered a bug in our SDK, our support team is available at [email protected] to make sure the issue is taken care of as quickly as possible. There is nothing like too much information in these cases so make sure you: | ||
- Describe your environment | ||
- Provide detailed reproduction steps | ||
- Provide a minimal reproduction project: this isn’t compulsory but will reduce greatly the resolution time | ||
- Include detailed logs: It’s best to provide the rawest logs possible, please don’t try filter them | ||
- Includes a Stack Trace: If your issue involves a crash, this is absolutely compulsory, and should be as raw as possible | ||
|
||
You can also open an issue for it, using the appropriate template and respecting the same rules. However, we do have a longer response time here than by email or the Live Chat. | ||
|
||
# Pull requests | ||
We don’t accept pull requests at the moment. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Batch SDK use in source and binary forms, with or without modification, is permitted only to allow use of the Batch platform by Batch customers. | ||
|
||
Batch SDK can be embedded in Batch customers websites, but redistribution of Batch SDK in source and binary forms, with or without modification is prohibited without the prior written permission of Batch. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<img src="https://static.batch.com/documentation/Readmes/[email protected]" srcset="https://static.batch.com/documentation/Readmes/logo_batch_full_178.png 1x" width="178" height="68" alt="Batch Logo" /> | ||
|
||
# Batch Web SDK | ||
|
||
The Batch Web SDK allows you to build a meaningful communication experience in your website through highly personalized push notifications. | ||
|
||
Our [📕 setup documentation](https://doc.batch.com/web/prerequisites) details the steps to take for an easy and successful integration. | ||
|
||
# Prerequisites | ||
|
||
Batch is compatible with the following browsers: | ||
|
||
- Firefox 53 or higher | ||
- Chrome 55 or higher | ||
- Edge 75 or higher | ||
- Safari 12 or higher | ||
|
||
|
||
# Documentation | ||
- [Setup guide](https://doc.batch.com/web/prerequisites): start your implementation here! | ||
- [Help center](https://help.batch.com/en/): answers to most questions you may have during the integration | ||
- [API reference](https://doc.batch.com/web-api-reference/index.html): this documents each of the classes and methods in the Batch Web SDK | ||
|
||
You may also find this guide useful to review after integration to make sure you're ready to go live: [How can I test my web push integration?](https://help.batch.com/en/articles/4819177-how-can-i-test-my-web-push-integration) | ||
|
||
# Building | ||
|
||
Build instructions are detailed in [BUILDING.md](BUILDING.md). | ||
|
||
# Contributing | ||
|
||
Please refer to our [contributing guidelines](CONTRIBUTING.md). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Browsers that we support | ||
|
||
Firefox > 52 | ||
Chrome > 54 | ||
edge > 15 | ||
safari >= 12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# top-most EditorConfig file | ||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
|
||
[*.js] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[*.ts] | ||
indent_style = space | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.css.d.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"trailingComma": "es5", | ||
"printWidth": 140, | ||
"arrowParens": "avoid" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
nodeLinker: node-modules | ||
|
||
plugins: | ||
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs | ||
spec: "@yarnpkg/plugin-interactive-tools" | ||
|
||
yarnPath: .yarn/releases/yarn-3.2.0.cjs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
This TSConfig references the public | ||
|
||
Typescript will compile the referenced files for every context, so there is no need to reference the "lib/" projects. | ||
|
||
The lib/ tsconfigs are for autocompletion. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/* mock file, for test only */ | ||
export const SDK_API_LVL = 2; | ||
export const SDK_DISMISS_NOTIF_AFTER = 30; | ||
export const RETRY_MAX_ATTEMPTS = 3; | ||
export const RETRY_MIN_INTERVAL_MS = 5; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/* eslint-env jest */ | ||
import { RETRY_MAX_ATTEMPTS, RETRY_MIN_INTERVAL_MS } from "../config"; | ||
|
||
test("real config is safe", () => { | ||
expect(RETRY_MAX_ATTEMPTS).toBe(3); | ||
expect(RETRY_MIN_INTERVAL_MS).toBe(1000); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* eslint-env jest */ | ||
|
||
import deepObjectCompare from "com.batch.shared/helpers/deep-obj-compare"; | ||
|
||
const a = { | ||
rando: "coucou", | ||
bojo: 465465, | ||
item: { | ||
p1: {}, | ||
bol: true, | ||
fal: false, | ||
}, | ||
}; | ||
|
||
const b = { | ||
rando: "coucou", | ||
bojo: 465465, | ||
item: { | ||
p1: {}, | ||
bol: true, | ||
fal: false, | ||
}, | ||
}; | ||
|
||
const c = { | ||
rando: "couCou", | ||
bojo: 465465, | ||
item: { | ||
p1: {}, | ||
bol: true, | ||
fal: false, | ||
}, | ||
}; | ||
|
||
const d = { | ||
rando: "coucou", | ||
bojo: [465465], | ||
item: { | ||
p1: {}, | ||
bol: true, | ||
fal: false, | ||
}, | ||
}; | ||
|
||
test("same shit", () => { | ||
expect(deepObjectCompare(a, b)).toBe(true); | ||
}); | ||
|
||
test("not same shit", () => { | ||
expect(deepObjectCompare(a, c)).toBe(false); | ||
expect(deepObjectCompare(a, d)).toBe(false); | ||
}); | ||
|
||
test("with first object empty", () => { | ||
expect(deepObjectCompare({}, b)).toBe(false); | ||
}); | ||
|
||
test("with second object empty", () => { | ||
expect(deepObjectCompare(a, {})).toBe(false); | ||
}); |
Oops, something went wrong.