Skip to content

Commit

Permalink
Merge pull request #975 from OneSignal/user_model_rebase
Browse files Browse the repository at this point in the history
Merge user_model/main into main
  • Loading branch information
jennantilla authored Mar 6, 2024
2 parents 4ed52df + fdcd44c commit cb45da1
Show file tree
Hide file tree
Showing 32 changed files with 2,755 additions and 2,031 deletions.
82 changes: 82 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ "main", "user_model/main" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "main", "user_model/main" ]
schedule:
- cron: '37 19 * * 4'

jobs:
analyze:
name: Analyze
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners
# Consider using larger runners for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'javascript-typescript' ]
# CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ]
# Use only 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
456 changes: 456 additions & 0 deletions MIGRATION_GUIDE.md

Large diffs are not rendered by default.

7 changes: 0 additions & 7 deletions build-extras-onesignal.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
import java.nio.file.Files

android.defaultConfig {
manifestPlaceholders = [
onesignal_app_id: '', // Use from js code
onesignal_google_project_number: 'REMOTE'
]
}

// Required for Android Support Library 26.0.0+ and Google Play services 11.+
repositories {
maven { url 'https://maven.google.com' }
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "3.3.1",
"version": "5.0.6",
"name": "onesignal-cordova-plugin",
"cordova_name": "OneSignal Push Notifications",
"description": "OneSignal is a high volume Push Notification service for mobile apps. In addition to basic notification delivery, OneSignal also provides tools to localize, target, schedule, and automate notifications that you send.",
Expand Down
17 changes: 13 additions & 4 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<plugin xmlns="http://www.phonegap.com/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
id="onesignal-cordova-plugin"
version="3.3.1">
version="5.0.6">

<name>OneSignal Push Notifications</name>
<author>Josh Kasten, Bradley Hesse, Rodrigo Gomez-Palacio</author>
Expand All @@ -26,12 +26,20 @@
</engines>

<js-module src="dist/NotificationReceivedEvent.js" name="NotificationReceivedEvent" />
<js-module src="dist/Subscription.js" name="Subscription" />
<js-module src="dist/OSNotification.js" name="OSNotification" />
<js-module src="dist/UserNamespace.js" name="UserNamespace" />
<js-module src="dist/PushSubscriptionNamespace.js" name="PushSubscriptionNamespace" />
<js-module src="dist/DebugNamespace.js" name="DebugNamespace" />
<js-module src="dist/InAppMessagesNamespace.js" name="InAppMessagesNamespace" />
<js-module src="dist/SessionNamespace.js" name="SessionNamespace" />
<js-module src="dist/LocationNamespace.js" name="LocationNamespace" />
<js-module src="dist/NotificationsNamespace.js" name="NotificationsNamespace" />
<js-module src="dist/LiveActivitiesNamespace.js" name="LiveActivitiesNamespace" />

<platform name="android">
<framework src="com.onesignal:OneSignal:4.8.5" />
<framework src="com.onesignal:OneSignal:5.1.4" />
<framework src="build-extras-onesignal.gradle" custom="true" type="gradleReference" />
<framework src="org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.10" />

<config-file target="res/xml/config.xml" parent="/*">
<feature name="OneSignalPush" >
Expand All @@ -47,6 +55,7 @@
<source-file src="src/android/com/onesignal/cordova/OneSignalOutcomeController.java" target-dir="src/com/onesignal/cordova/" />
<source-file src="src/android/com/onesignal/cordova/OneSignalInAppMessagingController.java" target-dir="src/com/onesignal/cordova/" />
<source-file src="src/android/com/onesignal/cordova/CallbackHelper.java" target-dir="src/com/onesignal/cordova/" />
<source-file src="src/android/com/onesignal/cordova/OneSignalUtils.java" target-dir="src/com/onesignal/cordova/" />
</platform>

<!-- ios -->
Expand Down Expand Up @@ -76,7 +85,7 @@
<source url="https://cdn.cocoapods.org/"/>
</config>
<pods use-frameworks="true">
<pod name="OneSignalXCFramework" spec="3.12.4" />
<pod name="OneSignalXCFramework" spec="5.1.0" />
</pods>
</podspec>

Expand Down
12 changes: 12 additions & 0 deletions src/android/com/onesignal/cordova/CallbackHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,24 @@ public static void callbackSuccess(CallbackContext callbackContext, JSONObject j
callbackContext.sendPluginResult(pluginResult);
}

public static void callbackSuccessInt(CallbackContext callbackContext, int param) {
PluginResult pluginResult = new PluginResult(PluginResult.Status.OK, param);
pluginResult.setKeepCallback(true);
callbackContext.sendPluginResult(pluginResult);
}

public static void callbackSuccessBoolean(CallbackContext callbackContext, boolean param) {
PluginResult pluginResult = new PluginResult(PluginResult.Status.OK, param);
pluginResult.setKeepCallback(true);
callbackContext.sendPluginResult(pluginResult);
}

public static void callbackSuccessString(CallbackContext callbackContext, String param) {
PluginResult pluginResult = new PluginResult(PluginResult.Status.OK, param);
pluginResult.setKeepCallback(true);
callbackContext.sendPluginResult(pluginResult);
}

public static void callbackError(CallbackContext callbackContext, JSONObject jsonObject) {
if (jsonObject == null) // in case there are no data
jsonObject = new JSONObject();
Expand Down
Loading

0 comments on commit cb45da1

Please sign in to comment.