Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Dev App] Adding some misc buttons for development and testing #1955

Open
wants to merge 305 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
305 commits
Select commit Hold shift + click to select a range
74e0d86
[User Model] Application Focus and Threading
brismithers Jan 18, 2023
46bee80
[User Model] Provide serialization mechanism for external classes
brismithers Jan 18, 2023
5b434fd
Merge pull request #1722 from OneSignal/user-model/focus-and-threading
brismithers Jan 19, 2023
3453d43
Merge pull request #1723 from OneSignal/user-model/tojsonobject
brismithers Jan 19, 2023
24201b4
[User Model] Successfully recover from failing operations
brismithers Jan 19, 2023
8c56a63
[User Model] Add "OneSignal-Subscription-Id" header to requests
brismithers Jan 20, 2023
7996fe3
Merge pull request #1724 from OneSignal/user-model/operation-recover
brismithers Jan 20, 2023
7f06356
Merge pull request #1725 from OneSignal/user-model/subscription-id-he…
brismithers Jan 20, 2023
2412676
[User Model] Transfer Subscription on user create
brismithers Jan 24, 2023
7a31edd
[User Model] Support migrating user from SDK 4.x to SDK 5.x
brismithers Jan 25, 2023
674fd4a
Merge pull request #1726 from OneSignal/user-model/xfer-subscription-…
brismithers Jan 25, 2023
0478d56
merge from user-model/main
brismithers Jan 25, 2023
2e841d7
Merge pull request #1727 from OneSignal/user-model/sdk-migration
brismithers Jan 27, 2023
117b682
[User Model] Fix broken unit test compilation
brismithers Jan 30, 2023
3e3011c
Merge pull request #1728 from OneSignal/user-model/unit-test-fixup
brismithers Jan 30, 2023
454bf34
[User Model] Add validation logic to add/remove email & sms subscript…
brismithers Jan 30, 2023
db5c56a
Merge pull request #1729 from OneSignal/user-model/email-sms-validation
brismithers Jan 30, 2023
8e4337f
[User Model] Pre-Beta Fixes
brismithers Feb 2, 2023
952de92
Merge pull request #1730 from OneSignal/user-model/pre-beta-fixes
brismithers Feb 2, 2023
8e64caa
[User Model] Properly set `isUnattributedEnabled` to config when spec…
brismithers Feb 2, 2023
f97cfdd
Merge pull request #1731 from OneSignal/user-model/enable-unattribute…
brismithers Feb 2, 2023
6b5b1fe
[User Model] Beta Release Prep
brismithers Feb 2, 2023
9fc1c61
Merge pull request #1732 from OneSignal/user-model/beta-prep
brismithers Feb 3, 2023
e346164
[User Model] Make `sdkVersion` in OneSignalWrapper settable.
brismithers Feb 3, 2023
8499e90
Merge pull request #1733 from OneSignal/user-model/wrapper-sdkversion…
brismithers Feb 16, 2023
3f2060f
[User Model] Expose `INotification.rawPayload`
brismithers Feb 16, 2023
937ac66
Release 5.0.0-beta2
brismithers Feb 16, 2023
964ab9f
Merge pull request #1736 from OneSignal/user-model/raw-payload
brismithers Feb 16, 2023
fde36dc
Merge pull request #1737 from OneSignal/user-model/beta-2-release-prep
brismithers Feb 16, 2023
018a330
Update logic for detecting when to show fallback settings for request…
brismithers Feb 28, 2023
72d663d
Remove `retain_previous_owner` parameter from "Create User" and "Crea…
brismithers Mar 1, 2023
f8c0d29
Use correct reflection method retrieval of isHuaweiMobileServicesAvai…
brismithers Mar 1, 2023
d4f42e4
* Update example app to use `com.onesignal.sdk.test` application id a…
brismithers Mar 6, 2023
9f7171e
Merge pull request #1740 from OneSignal/user-model/remove-retain-prev…
brismithers Mar 7, 2023
3ad1b97
Merge pull request #1739 from OneSignal/user-model/permission-fallbac…
brismithers Mar 7, 2023
0e1ca74
[User Model] ADM Fixes
brismithers Mar 8, 2023
d9f4023
[User Model] Safeguard against activities/services/receivers being ca…
brismithers Mar 9, 2023
ff3081e
Merge pull request #1742 from OneSignal/user-model/huawei-fixes
brismithers Mar 14, 2023
f314151
Merge pull request #1744 from OneSignal/user-model/adm-support
brismithers Mar 14, 2023
f9b0f75
Merge pull request #1746 from OneSignal/user-model/upgrade-receiver-c…
brismithers Mar 14, 2023
5124ed0
[User Model] ensure 100% unit test pass
brismithers Mar 20, 2023
fe5f854
[User Model] Don't show "Missing Google Project number!" error messag…
brismithers Mar 20, 2023
ad10873
[User Model] Change `addTrigger` to accept a `String` instead of `Any`
brismithers Mar 27, 2023
b13819e
[User Model] Make ktlint fixes
brismithers Mar 29, 2023
cbbb7fa
Update ktlint plugin to `11.3.1`, fix ktlint version to `0.48.2`
brismithers Mar 30, 2023
82f0774
Merge pull request #1754 from OneSignal/user-model/trigger-as-string
brismithers Mar 30, 2023
0b3a432
Merge pull request #1750 from OneSignal/user-model/incorrect-error-me…
brismithers Mar 30, 2023
7461ecf
Merge branch 'user-model/main' into user-model/ktlint-fixes
brismithers Mar 30, 2023
fdee4a7
Fix lint errors from merge
brismithers Mar 30, 2023
f1f7bcb
Merge pull request #1758 from OneSignal/user-model/ktlint-fixes
brismithers Mar 30, 2023
b62b895
Merge from user-model/main
brismithers Mar 30, 2023
4172f8b
Merge pull request #1749 from OneSignal/user-model/broken-unit-tests
brismithers Apr 17, 2023
822eb71
Update high level components to be accessed via pascal casing.
brismithers Apr 17, 2023
e7c9594
Merge pull request #1764 from OneSignal/user-model/pascal-case-areas
brismithers Apr 18, 2023
ee63a38
[User Model] Rename notification event listeners
brismithers Apr 19, 2023
8a9e6e6
Update OneSignalSDK/onesignal/core/src/main/java/com/onesignal/notifi…
brismithers Apr 20, 2023
8d0cd40
Update OneSignalSDK/onesignal/core/src/main/java/com/onesignal/notifi…
brismithers Apr 20, 2023
1da3636
Update OneSignalSDK/onesignal/core/src/main/java/com/onesignal/notifi…
brismithers Apr 20, 2023
bbed11d
Update OneSignalSDK/onesignal/core/src/main/java/com/onesignal/notifi…
brismithers Apr 20, 2023
9ad8e09
Update OneSignalSDK/onesignal/core/src/main/java/com/onesignal/notifi…
brismithers Apr 20, 2023
28dac77
Code review comment updates
brismithers Apr 20, 2023
bbeb09d
Updates for lintcheck
brismithers Apr 24, 2023
88559d5
Update migration guide with new notification events naming
brismithers Apr 24, 2023
ede53a0
Merge pull request #1765 from OneSignal/user-model/notification-events
brismithers Apr 25, 2023
1f15b7a
[User Model] Update IAM with events terminologies
brismithers Apr 25, 2023
ab6fe90
Update InAppMessageClickEvent/Result
jennantilla Apr 28, 2023
ef2b432
Updating the notification click result to have actionId and URL
emawby Apr 28, 2023
ac3a2ab
[User Model] User Push Subscription Event update
brismithers Apr 27, 2023
e5a748c
Fire onSubscriptionChanged event for all subscription types
emawby Apr 28, 2023
c77c903
Merge pull request #1767 from OneSignal/user-model/click_event_result
emawby May 1, 2023
ce67625
Merge pull request #1766 from OneSignal/user-model/iam-events
emawby May 1, 2023
49480f0
Add PushSubscriptionObserver methods to the migration guide
emawby May 1, 2023
23433b6
Merge pull request #1768 from OneSignal/user-model/user-events
emawby May 1, 2023
4665148
Bumping versions for beta 3
emawby May 1, 2023
7f56342
Merge pull request #1769 from OneSignal/user-model/beta3_release
emawby May 1, 2023
46efcf9
Add the override modifier to InAppMessageActionUrlType toString
emawby May 1, 2023
3611eaa
change the huawei package name to com.onesignal.sdktest
emawby May 1, 2023
3706902
adding toJSONObject for push subscription changed event parameters
emawby May 3, 2023
491fb92
Updating the privacy consent property names
emawby May 3, 2023
b743588
Fix outcomes unit tests so tests pass
emawby May 3, 2023
5064005
Merge pull request #1771 from OneSignal/user-model/update_privacy_con…
emawby May 4, 2023
3e39c0a
Merge pull request #1770 from OneSignal/user-model/add_to_json_object
emawby May 4, 2023
6e58fa0
bumping version numbers for beta 4 release
emawby May 4, 2023
f5e9056
Update MIGRATION_GUIDE.md for new privacy consent names
emawby May 4, 2023
81fc303
Merge pull request #1772 from OneSignal/user-model/beta4_release
emawby May 8, 2023
5d04aeb
Add device type to the outcome event request
nan-li Jul 31, 2023
19afb08
Add session_time to OutcomeEvent
nan-li Aug 6, 2023
43fa3cc
Send influenced session outcome
nan-li Aug 6, 2023
49ed920
update outcomes table to include `session_time` column
nan-li Aug 6, 2023
97a2bce
Fixing unit tests after outcomes changes
nan-li Aug 6, 2023
f1d204e
Modify create user operation to send less associated info
nan-li Aug 7, 2023
da91c6a
Fix tests after create user operation changes
nan-li Aug 7, 2023
b1b4d99
[nit] add note about `OutcomeEventParams.timestamp`
nan-li Aug 7, 2023
5a33afe
Make subscribers in EventProducer synchronized
emawby Aug 7, 2023
aed2897
Merge pull request #1796 from OneSignal/fix/event_producer_crash
emawby Aug 8, 2023
8b58c6e
Update PreferenceStores bool upon granting permission
jennantilla Aug 9, 2023
b8441cc
Merge pull request #1798 from OneSignal/fix/canRequestPermission_retu…
emawby Aug 10, 2023
b3eb9b9
Bump firebase-messaging dependency version to 23.0.0
jennantilla Aug 10, 2023
a3b2f17
Bump demo app minSdk from 16 to 19
jennantilla Aug 10, 2023
5fd6dfb
Adding zapier, release-drafter, and response time actions
emawby Aug 10, 2023
fda8ee2
Merge pull request #1800 from OneSignal/user_model/copy_actions_from_…
emawby Aug 10, 2023
977130c
Merge pull request #1793 from OneSignal/user_model/fix_outcome_requests
emawby Aug 10, 2023
9cbbf70
Merge pull request #1801 from OneSignal/user-model/ga_updates
emawby Aug 10, 2023
67c2c52
Merge pull request #1794 from OneSignal/user_model/improve_create_use…
emawby Aug 10, 2023
8ab25ce
set inAppMessageIdShowing back to null after display
jennantilla Aug 9, 2023
ed80fcc
Merge pull request #1799 from OneSignal/fix/iam
emawby Aug 10, 2023
7cf7038
Don't crash if login fails
emawby Aug 10, 2023
67912a4
Don't throw for bad alias actions
emawby Aug 10, 2023
54fb095
Don't throw for bad email and sms tokens
emawby Aug 10, 2023
2a8fc52
Don't throw for empty tag keys
emawby Aug 10, 2023
950b275
Merge pull request #1802 from OneSignal/user_model/remove_throws
emawby Aug 10, 2023
f10913f
Update version for v5.0.0 release
nan-li Aug 10, 2023
fb30348
Update migration guide
nan-li Aug 10, 2023
82fc8e8
Merge pull request #1803 from OneSignal/rel/5.0.0
nan-li Aug 10, 2023
c97fdb3
Update proguard rules with new classes
jennantilla Aug 30, 2023
bce0f2f
protecting all classmembers via consumer-rules.pro
emawby Sep 1, 2023
bb3041e
Merge pull request #1828 from OneSignal/fix/proguard_updates
emawby Sep 7, 2023
a54f90c
bump to version 5.0.1
emawby Sep 7, 2023
fea6fa1
Merge pull request #1831 from OneSignal/release-5.0.1
emawby Sep 7, 2023
669fa51
Fix bug for generating notification's android notification ID
nan-li Sep 15, 2023
b4de371
Differentiate login failure cases
nan-li Sep 15, 2023
7fe6a47
Send timezone_id on createuser
emawby Sep 15, 2023
9a1bee3
Update unit tests to account for properties in createUser
emawby Sep 18, 2023
2e4b382
Rename kotlin modules to be named after namespace
shepherd-l Sep 20, 2023
545e5cd
Change notification time out log level to info
shepherd-l Sep 20, 2023
9f7f9a0
Merge pull request #1844 from OneSignal/rename-kotlin-modules
shepherd-l Sep 20, 2023
b65c008
Fix crash from missing operationExecutor in OperationModelStore create
emawby Sep 21, 2023
cbfaeb9
Merge pull request #1845 from OneSignal/fix/crash_on_login_from_user_sub
emawby Sep 21, 2023
ea70883
Replace messageView non-null assertion with safe call operator
jennantilla Sep 21, 2023
6fab6bb
Send language on createuser
jennantilla Sep 21, 2023
2f3cc69
Update unit tests to account for language properties in createUser
jennantilla Sep 21, 2023
cfca9ce
Access ILanguageContext for setting language on createUser
jennantilla Sep 22, 2023
2e04cd1
Merge pull request #1840 from OneSignal/user_model/fix_notifications_…
emawby Sep 22, 2023
9a5c959
Merge pull request #1841 from OneSignal/user_model/add_login_409_logs
emawby Sep 22, 2023
cdc09c1
Clarify comment for showView execution
jennantilla Sep 22, 2023
d49858c
Update LoginUserOperationExecutor tests to take in parameter MockHelp…
jennantilla Sep 22, 2023
7bd784f
make getTimeZoneId non-optional
emawby Sep 22, 2023
3402c6d
Fix concurrent modification exception in Model.kt
emawby Sep 22, 2023
2de5c46
Merge pull request #1846 from OneSignal/fix/in_app_npe_crash
emawby Sep 25, 2023
6839f4c
Merge pull request #1842 from OneSignal/fix/timezone_id_not_set
emawby Sep 25, 2023
1c184ff
Merge branch 'user-model/main' into fix/language_not_set
jennantilla Sep 25, 2023
bb041ad
Merge pull request #1847 from OneSignal/fix/language_not_set
jennantilla Sep 25, 2023
a5c88de
Merge pull request #1849 from OneSignal/fix/concurrent_modification_e…
emawby Sep 25, 2023
079139c
Version bump for release
jennantilla Sep 25, 2023
3488c90
Merge pull request #1852 from OneSignal/rel/5.0.2
jennantilla Sep 25, 2023
1541487
Fix Amazon purchase tracking setup
nan-li Oct 4, 2023
9794d5e
Differentiate appstore v3.0.4
nan-li Oct 5, 2023
b253e40
Read in dismissed IAMs on IAM Manager start
nan-li Oct 6, 2023
c864d7d
Merge pull request #1860 from OneSignal/fix/amazon_purchase_tracking_…
nan-li Oct 6, 2023
52e27ea
Merge pull request #1863 from OneSignal/fix/iam_showing_on_app_launch
nan-li Oct 6, 2023
3bf087e
release commit 5.0.3
nan-li Oct 6, 2023
1721ec7
Merge pull request #1865 from OneSignal/rel/android_5.0.3
nan-li Oct 6, 2023
243cb0a
WIP add synchronization blocks to prevent ConcurrentModificationExcep…
jennantilla Oct 18, 2023
7b8444d
Update ktlint version
shepherd-l Oct 25, 2023
3899146
Run ktlint format
shepherd-l Oct 25, 2023
aed50e6
Fix wildcard import linting error
shepherd-l Oct 25, 2023
92ae453
Increase linting max line length
shepherd-l Oct 25, 2023
cf9aef5
Fix comment linting errors
jennantilla Oct 25, 2023
b24c3a6
Fix import linting errors
jennantilla Oct 25, 2023
f837e97
update location module property naming
jennantilla Oct 25, 2023
af506e7
Update InAppMessages property naming
jennantilla Oct 25, 2023
56948ba
Update core module property naming
jennantilla Oct 25, 2023
151a7f9
Update notifications module property naming
jennantilla Oct 26, 2023
e8801c2
Bump minimum SDK version to 19
shepherd-l Oct 26, 2023
c0c6e9d
Remove detekt
shepherd-l Oct 26, 2023
43f36f4
Merge pull request #1881 from OneSignal/remove-detekt
shepherd-l Oct 26, 2023
0fb3003
Merge branch 'user-model/main' into fix/linting
jennantilla Oct 26, 2023
0ee4ef3
Update PropertiesModel's deserialization of tags to not use `Model.in…
brismithers Oct 27, 2023
2a8ce6a
General protection against exceptions that occur on a thread.
brismithers Oct 30, 2023
390f1f0
Retrieve current ADM PurchasingListener assuming it returns a nullable.
brismithers Oct 31, 2023
1ec2723
Merge pull request #1884 from OneSignal/issues/1874-deserialize-tag-w…
brismithers Nov 1, 2023
ec3d03d
Merge pull request #1888 from OneSignal/issues/1812-adm-purchase-list…
brismithers Nov 1, 2023
9447835
Add synchronized block to get method
jennantilla Nov 1, 2023
e8bf0e8
Update initializeFromModel to never clear the model id
jennantilla Nov 1, 2023
68d2b5a
Update initializeFromModel to build a local map to replace data
jennantilla Nov 1, 2023
ca26745
Merge pull request #1882 from OneSignal/fix/linting
jennantilla Nov 1, 2023
c742bbf
Merge branch 'user-model/main' into fix/concurrent_modification_excep…
jennantilla Nov 2, 2023
81cb885
Update work-runtime dependency version
jennantilla Nov 2, 2023
f5fe01e
Update comment linting errors
jennantilla Nov 2, 2023
df534d5
Add additional synchronized blocks to get methods
jennantilla Nov 2, 2023
1847cb4
Revert "Add additional synchronized blocks to get methods"
jennantilla Nov 3, 2023
ae758cf
Add synchronized blocks to model get and set methods
jennantilla Nov 3, 2023
d8abaee
Merge pull request #1876 from OneSignal/fix/concurrent_modification_e…
jennantilla Nov 3, 2023
5df036a
Merge pull request #1883 from OneSignal/fix/unitTests
jennantilla Nov 3, 2023
7d994a9
Merge pull request #1890 from OneSignal/fix/work-runtime_dependency_bump
jennantilla Nov 3, 2023
a86c887
Merge pull request #1891 from OneSignal/fix/PropertiesModelTests_linting
jennantilla Nov 3, 2023
9d66a3d
Merge pull request #1887 from OneSignal/issues/1871-protect-thread-ex…
jennantilla Nov 3, 2023
f8162dc
Update version for v5.0.4 release
jennantilla Nov 3, 2023
3f00ac1
Update formatting to pass lint test
jennantilla Nov 3, 2023
ff841f9
Merge pull request #1899 from OneSignal/rel/5.0.4
jennantilla Nov 3, 2023
0cf1eb9
pause operation repo and retry on failed user create
nan-li Nov 4, 2023
2883b97
Fix issue with migration from v4 to v5 when obfuscation was used by t…
brismithers Nov 6, 2023
aa9ce40
Fix linting errors with PreferenceStoreFix and OneSignalImp
brismithers Nov 7, 2023
0dbbb54
add public getTags method
jinliu9508 Nov 2, 2023
69d53b4
add test for getTags
jinliu9508 Nov 2, 2023
4702341
Add test case for getTags should reflect any tags modification
jinliu9508 Nov 7, 2023
2a27f24
add refresh_device_metadata to create user request
nan-li Nov 6, 2023
dcc3860
Merge pull request #1901 from OneSignal/fix-v4-to-v5-preference-store…
brismithers Nov 14, 2023
39af8e8
initWithContext synchronization fix (#1903)
brismithers Nov 14, 2023
2cdc61f
Move UserState and related classes into the user directory
jinliu9508 Nov 16, 2023
1983626
Revert "Move UserState and related classes into the user directory"
jinliu9508 Nov 16, 2023
aa4d1c6
Update the Migration Guide to include getTags
jinliu9508 Nov 16, 2023
1874bb1
Fix the indentationError caught by lint
jinliu9508 Nov 16, 2023
a735dee
Another attempt to fix the lint problem
jinliu9508 Nov 16, 2023
c01861d
Fix lint issue
jinliu9508 Nov 16, 2023
b944a41
Remove white space
jinliu9508 Nov 16, 2023
9051c34
Fix lint issue
jinliu9508 Nov 16, 2023
3473924
Add space
jinliu9508 Nov 16, 2023
41b418e
Merge pull request #1893 from OneSignal/add-public-getTags-method
jinliu9508 Nov 16, 2023
a5bfd21
Merge pull request #1911 from OneSignal/add_refresh_device_metadata_t…
nan-li Nov 17, 2023
d5ead88
Rename an internal method for clarity
nan-li Nov 13, 2023
940c8f1
Add device properties to Subscription Model
nan-li Nov 30, 2023
bd5ce9c
Initialize push subscription model with device data
nan-li Nov 30, 2023
d9b7d01
On new sessions, check for subscription property updates
nan-li Nov 30, 2023
c3e618c
Don't hydrate device info for a push subscription model
nan-li Nov 30, 2023
7c8167d
Fix some test units and a linting issue
jinliu9508 Dec 1, 2023
fef3aad
Merge pull request #1922 from OneSignal/update_between_sessions
nan-li Dec 1, 2023
6334a24
Merge pull request #1900 from OneSignal/v5_retry_failed_create_user
nan-li Dec 1, 2023
d5a7cae
bump sdk version
jennantilla Dec 1, 2023
7697097
Merge pull request #1928 from OneSignal/rel/5.0.5
jennantilla Dec 1, 2023
6865aad
Update trigger model to always drive a change event when changing the…
brismithers Dec 5, 2023
ad7bd62
Wait for activity to be set rather than immediately return in waitUnt…
brismithers Dec 5, 2023
834bbca
Add UserStateObserver that returns both previous and current use states
jinliu9508 Nov 14, 2023
3f750aa
Remove code related to the previous user state
jinliu9508 Dec 5, 2023
4db5412
Allow app to be opened on notification clicked if onclick event is added
jinliu9508 Dec 4, 2023
8e6fb1f
call bindService with applicationContext
jinliu9508 Dec 7, 2023
0664cbb
Improve comments
jinliu9508 Dec 8, 2023
0d4c544
Merge pull request #1931 from OneSignal/notification-click-not-fired-…
jinliu9508 Dec 11, 2023
49fbe04
Merge pull request #1935 from OneSignal/crash-bindService-with-Broadc…
jinliu9508 Dec 13, 2023
3b89ac5
Update comments to better explain the IDs
jinliu9508 Dec 13, 2023
ebc7ea2
Add try/catch block to cancelLocationUpdates
jennantilla Dec 13, 2023
c0b8592
Update startGetLocation to only run if location is shared
jennantilla Dec 13, 2023
7bc4aa3
Fix linting error
jennantilla Dec 13, 2023
ec79584
Update startGetLocation to return early if isShared is false
jennantilla Dec 13, 2023
85689d8
Update cancelLocationUpdates to check for googleApiClient connection …
jennantilla Dec 14, 2023
8863284
Merge pull request #1940 from OneSignal/fix/catch_exception_for_locat…
jennantilla Dec 15, 2023
f275b24
Update isShared default to false
jennantilla Dec 20, 2023
a7d7a72
Allow for mid-session update of location permission
jennantilla Dec 20, 2023
fc842b9
Remove early return for requestPermission
jennantilla Dec 26, 2023
8b0b74b
Update LocationManager
jennantilla Dec 27, 2023
c5f48ad
Merge pull request #1942 from OneSignal/fix/location_sharing
jennantilla Dec 28, 2023
62e12c4
Update Migration Guide with ID getters and observer
nan-li Dec 28, 2023
52ea988
Merge pull request #1909 from OneSignal/AddUserStateChangeObserver
nan-li Dec 28, 2023
b3997fe
Remove ACCESS_COARSE_LOCATION permission
shepherd-l Dec 19, 2023
230980a
Update comment
shepherd-l Dec 27, 2023
5796b70
Merge pull request #1949 from OneSignal/removeAccessCoarseLocation
shepherd-l Dec 28, 2023
5afd333
Bump SDK version
jennantilla Dec 28, 2023
52987ab
Merge pull request #1952 from OneSignal/rel/5.1.0
jennantilla Dec 28, 2023
6a1f1a2
[Dev App] add some misc buttons for testing
nan-li Jan 6, 2024
eb34f95
nit
nan-li Jan 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
58 changes: 58 additions & 0 deletions .github/os_probot_metadata.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/**
* Based on probot-metadata - https://github.com/probot/metadata
*/
const regex = /\n\n<!-- probot = (.*) -->/

const { Octokit } = require("@octokit/action")

const octokit = new Octokit()

module.exports = (context, issue = null) => {
console.log(context)
const prefix = "onesignal-probot"

if (!issue) issue = context.payload.issue

return {
async get (key = null) {
let body = issue.body

if (!body) {
body = (await octokit.issues.get(issue)).data.body || ''
}

const match = body.match(regex)

if (match) {
const data = JSON.parse(match[1])[prefix]
return key ? data && data[key] : data
}
},

async set (key, value) {
let body = issue.body
let data = {}

if (!body) body = (await octokit.issues.get(issue)).data.body || ''

body = body.replace(regex, (_, json) => {
data = JSON.parse(json)
return ''
})

if (!data[prefix]) data[prefix] = {}

if (typeof key === 'object') {
Object.assign(data[prefix], key)
} else {
data[prefix][key] = value
}

body = `${body}\n\n<!-- probot = ${JSON.stringify(data)} -->`

const [owner, repo] = process.env.GITHUB_REPOSITORY.split("/")
const issue_number = context.payload.issue.number
return octokit.issues.update({ owner, repo, issue_number, body })
}
}
}
25 changes: 25 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name-template: $RESOLVED_VERSION
tag-template: $RESOLVED_VERSION
categories:
- title: 🚀 Features
label: Enhancement / Feature
- title: 🐛 Bug Fixes
label: Bug
- title: 🧰 Improvements
label: Improvement
change-template: '- $TITLE (#$NUMBER)'
version-resolver:
major:
labels:
- 'major'
minor:
labels:
- 'minor'
patch:
labels:
- 'patch'
default: patch
template: |
## Other Changes

$CHANGES
47 changes: 47 additions & 0 deletions .github/set_response_times.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
function calcResponseTimeForIssueCreatedAt(createdAt) {
const issueOpenedDate = new Date(createdAt);
const issueTriagedDate = new Date();
const businessDaysResponseTime = calcBusinessDaysBetweenDates(issueOpenedDate, issueTriagedDate);
return businessDaysResponseTime;
}

function calcBusinessDaysBetweenDates(openedDate, triagedDate) {
let differenceInWeeks, responseTime;
if (triagedDate < openedDate)
return -1; // error code if dates transposed
let openedDay = openedDate.getDay(); // day of week
let triagedDay = triagedDate.getDay();
openedDay = (openedDay == 0) ? 7 : openedDay; // change Sunday from 0 to 7
triagedDay = (triagedDay == 0) ? 7 : triagedDay;
openedDay = (openedDay > 5) ? 5 : openedDay; // only count weekdays
triagedDay = (triagedDay > 5) ? 5 : triagedDay;
// calculate differnece in weeks (1000mS * 60sec * 60min * 24hrs * 7 days = 604800000)
differenceInWeeks = Math.floor((triagedDate.getTime() - openedDate.getTime()) / 604800000);
if (openedDay < triagedDay) { //Equal to makes it reduce 5 days
responseTime = (differenceInWeeks * 5) + (triagedDay - openedDay);
}
else if (openedDay == triagedDay) {
responseTime = differenceInWeeks * 5;
}
else {
responseTime = ((differenceInWeeks + 1) * 5) - (openedDay - triagedDay);
}
return (responseTime);
}

module.exports = async(context, osmetadata) => {
const foundResponseTime = await osmetadata(context).get('response_time_in_business_days');
if (foundResponseTime) {
const foundString = "already found response time in business days: " + foundResponseTime
console.log(foundString);
return foundString;
}
if (context.payload.comment && context.payload.comment.author_association != "MEMBER" && context.payload.comment.author_association != "OWNER" && context.payload.comment.author_association != "CONTRIBUTOR") {
return;
}
const businessDaysResponseTime = calcResponseTimeForIssueCreatedAt(context.payload.issue.created_at);
console.log("response time in business days: " + businessDaysResponseTime);
const result = osmetadata(context, context.payload.issue).set('response_time_in_business_days', businessDaysResponseTime)
console.log("osmetadata update result: " + result);
return "set response time in business days: " + businessDaysResponseTime;
}
34 changes: 34 additions & 0 deletions .github/workflows/Zapier.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This is an action to close asana tasks that were generated by Github issues

name: Zapier web hook

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
issues:
types: [closed]

permissions:
issues: read

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Runs a set of commands using the runners shell
- name: Call Zapier web hook to close Asana task
if: ${{ !github.event.issue.pull_request }}
env:
ISSUE_TITLE: ${{ github.event.issue.title }}
run: |
curl --location --request POST 'https://hooks.zapier.com/hooks/catch/12728683/b7009qc/' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data-raw '{
"task_name" : "$ISSUE_TITLE"
}'
7 changes: 1 addition & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,10 @@ jobs:
working-directory: OneSignalSDK
run: |
./gradlew ktlintCheck --console=plain
- name: "[Test] Analyzing"
working-directory: OneSignalSDK
continue-on-error: true
run: |
./gradlew detekt --console=plain
- name: "[Test] SDK Unit Tests"
working-directory: OneSignalSDK
run: |
./gradlew unittest:testReleaseUnitTest --console=plain
./gradlew test --console=plain
- name: Unit tests results
if: failure()
uses: actions/upload-artifact@v3
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Release Drafter

on:
push:
# branches to consider in the event; optional, defaults to all
branches:
- main
# pull_request event is required only for autolabeler
pull_request:
# Only following types are handled by the action, but one can default to all as well
types: [opened, reopened, synchronize]
# pull_request_target event is required for autolabeler to support PRs from forks
# pull_request_target:
# types: [opened, reopened, synchronize]

permissions:
contents: read

jobs:
update_release_draft:
permissions:
# write permission is required to create a github release
contents: write
# write permission is required for autolabeler
# otherwise, read permission is required at least
pull-requests: write
runs-on: ubuntu-latest
steps:
# (Optional) GitHub Enterprise requires GHE_HOST variable set
#- name: Set GHE_HOST
# run: |
# echo "GHE_HOST=${GITHUB_SERVER_URL##https:\/\/}" >> $GITHUB_ENV

# Drafts your next Release notes as Pull Requests are merged into "master"
- uses: release-drafter/release-drafter@v5
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
# with:
# config-name: my-config.yml
# disable-autolabeler: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32 changes: 32 additions & 0 deletions .github/workflows/set_response_time.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Set Response Time
on:
issue_comment:
types:
- created
issues:
types:
- closed
jobs:
calculate:
name: set reponse time for the issue
if: github.event.issue.pull_request == null
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
- run: npm install @octokit/action
- uses: actions/github-script@v6
id: set-time
with:
result-encoding: string
script: |
const os_probot_metadata = require('./.github/os_probot_metadata.js')
const set_response_time = require('./.github/set_response_times.js')
return await set_response_time(context, os_probot_metadata)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Get result
run: echo "${{steps.set-time.outputs.result}}" >> $GITHUB_STEP_SUMMARY
82 changes: 54 additions & 28 deletions Examples/OneSignalDemo/app/agconnect-services.json
Original file line number Diff line number Diff line change
@@ -1,49 +1,75 @@
{
"agcgw":{
"backurl":"connect-dre.dbankcloud.cn",
"url":"connect-dre.hispace.hicloud.com",
"websocketbackurl":"connect-ws-dre.hispace.dbankcloud.cn",
"websocketurl":"connect-ws-dre.hispace.dbankcloud.com"
"backurl":"connect-dre.hispace.hicloud.com",
"url":"connect-dre.dbankcloud.cn",
"websocketbackurl":"connect-ws-dre.hispace.dbankcloud.com",
"websocketurl":"connect-ws-dre.hispace.dbankcloud.cn"
},
"agcgw_all":{
"CN":"connect-drcn.hispace.hicloud.com",
"CN_back":"connect-drcn.dbankcloud.cn",
"DE":"connect-dre.hispace.hicloud.com",
"DE_back":"connect-dre.dbankcloud.cn",
"RU":"connect-drru.hispace.hicloud.com",
"RU_back":"connect-drru.dbankcloud.cn",
"SG":"connect-dra.hispace.hicloud.com",
"SG_back":"connect-dra.dbankcloud.cn"
"CN":"connect-drcn.dbankcloud.cn",
"CN_back":"connect-drcn.hispace.hicloud.com",
"DE":"connect-dre.dbankcloud.cn",
"DE_back":"connect-dre.hispace.hicloud.com",
"RU":"connect-drru.hispace.dbankcloud.ru",
"RU_back":"connect-drru.hispace.dbankcloud.cn",
"SG":"connect-dra.dbankcloud.cn",
"SG_back":"connect-dra.hispace.hicloud.com"
},
"websocketgw_all":{
"CN":"connect-ws-drcn.hispace.dbankcloud.cn",
"CN_back":"connect-ws-drcn.hispace.dbankcloud.com",
"DE":"connect-ws-dre.hispace.dbankcloud.cn",
"DE_back":"connect-ws-dre.hispace.dbankcloud.com",
"RU":"connect-ws-drru.hispace.dbankcloud.ru",
"RU_back":"connect-ws-drru.hispace.dbankcloud.cn",
"SG":"connect-ws-dra.hispace.dbankcloud.cn",
"SG_back":"connect-ws-dra.hispace.dbankcloud.com"
},
"client":{
"cp_id":"5190001000034239317",
"product_id":"9105385871709201822",
"client_id":"336482233541985344",
"client_secret":"5E30C748A012DE67BAF83E2C542A4AB694CCAA89F1D5E8FCEFA57E0F28A077FB",
"project_id":"9105385871709201822",
"app_id":"102009847",
"api_key":"CV68fkx9E2fU8Fv/v3zbuO8+rCjJ8w6QiMha7ZJUpIGTxs08n0/ddVXbOueUKBtxf3sD+ni8WPx27htLHhtse5eP5VrT",
"package_name":"com.onesignal.example"
"product_id":"388421841221340564",
"client_id":"1103097158011211392",
"client_secret":"14843C60CAFDCFD5E50025C14864697AFF55886BCF00558E8C817F141E0B4704",
"project_id":"388421841221340564",
"app_id":"107780279",
"api_key":"DAEDAN06wwm3fsiHbQaQzugegFDUc6lpsR9VZGRNoWEbjHpDphR5rSbobUr5/ohT1WlRTyIykjr4GzzEJ/jSxlziFmXF/8e56HAYiw==",
"package_name":"com.onesignal.sdktest"
},
"oauth_client":{
"client_id":"102009847",
"client_id":"107780279",
"client_type":1
},
"app_info":{
"app_id":"102009847",
"package_name":"com.onesignal.example"
"app_id":"107780279",
"package_name":"com.onesignal.sdktest"
},
"service":{
"analytics":{
"collector_url":"datacollector-dre.dt.hicloud.com,datacollector-dre.dt.dbankcloud.cn",
"collector_url_ru":"datacollector-drru.dt.dbankcloud.ru,datacollector-drru.dt.hicloud.com",
"collector_url_sg":"datacollector-dra.dt.hicloud.com,datacollector-dra.dt.dbankcloud.cn",
"collector_url_de":"datacollector-dre.dt.hicloud.com,datacollector-dre.dt.dbankcloud.cn",
"collector_url_cn":"datacollector-drcn.dt.hicloud.com,datacollector-drcn.dt.dbankcloud.cn",
"resource_id":"p1",
"channel_id":""
},
"edukit":{
"edu_url":"edukit.edu.cloud.huawei.com.cn",
"dh_url":"edukit.edu.cloud.huawei.com.cn"
},
"search":{
"url":"https://search-dre.cloud.huawei.com"
},
"cloudstorage":{
"storage_url":"https://ops-dre.agcstorage.link"
"storage_url_sg_back":"https://agc-storage-dra.cloud.huawei.asia",
"storage_url_ru_back":"https://agc-storage-drru.cloud.huawei.ru",
"storage_url_ru":"https://agc-storage-drru.cloud.huawei.ru",
"storage_url_de_back":"https://agc-storage-dre.cloud.huawei.eu",
"storage_url_de":"https://ops-dre.agcstorage.link",
"storage_url":"https://agc-storage-drcn.platform.dbankcloud.cn",
"storage_url_sg":"https://ops-dra.agcstorage.link",
"storage_url_cn_back":"https://agc-storage-drcn.cloud.huawei.com.cn",
"storage_url_cn":"https://agc-storage-drcn.platform.dbankcloud.cn"
},
"ml":{
"mlservice_url":"ml-api-dre.ai.dbankcloud.com,ml-api-dre.ai.dbankcloud.cn"
Expand All @@ -53,17 +79,17 @@
"configuration_version":"3.0",
"appInfos":[
{
"package_name":"com.onesignal.example",
"package_name":"com.onesignal.sdktest",
"client":{
"app_id":"102009847"
"app_id":"107780279"
},
"app_info":{
"package_name":"com.onesignal.example",
"app_id":"102009847"
"package_name":"com.onesignal.sdktest",
"app_id":"107780279"
},
"oauth_client":{
"client_type":1,
"client_id":"102009847"
"client_id":"107780279"
}
}
]
Expand Down
Loading
Loading