onesignaldevelopers / onesignal-ionic-sample Goto Github PK
View Code? Open in Web Editor NEWLicense: Other
License: Other
On android, I added One Signal plugin on my app and i added this code on the platform.ready section
window["plugins"].OneSignal.setLogLevel({logLevel: 6, visualLevel: 6});
var notificationOpenedCallback = function(jsonData) {
console.log('notificationOpenedCallback: ' + JSON.stringify(jsonData));
};
window["plugins"].OneSignal
.startInit("******-****-****-****-***********", "**********")
.handleNotificationOpened(notificationOpenedCallback)
.endInit();
as i launch the app it shows a bunch of alerts sending requests to onesignal and the app suddenly closes and onesignal doesn’t detect any subscribers.
This example is deprecated. May you develop another one with Ionic 5 and Capacitor (new released with 3.0.10-alpha)?
I have a problem about turn on screen(wake up) android when message(push notification) incoming, Right now it just sound and vibration in back screen, there is message popup.
Hello! First of all thanks for this awesome plugin!
Second, my question is:
Why this still send INFO messages, all the times at the starting and ending app opening/launching?!
How can I stop this messages?
Thanks in advance!
Hello OneSignal, thanks for your great service.
I did all the instructions and uploaded my app, and than tried to send myself a push notification.
but nothing happenes and it says there isn't any users registered.
How am i supposed to register myself to check the app?
THanks,
Shaul.
The documentation for this project is really sparse. Since it is not detected by ionic current tooling, I would suggest an update to the documentation with the necessary information in order to setup it for running.
eg:
Module '"../../../../../OneSignal-Ionic-Example/node_modules/@angular/core/core"' has no exported member
'Renderer'. Did you mean 'Renderer2'?
Renderer has been deprecated since v4 and is removed in v9
My Angular is;
Angular CLI: 7.3.9
Node: 12.14.1
OS: win32 x64
Angular: 9.0.1
... common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic
@angular-devkit/architect 0.13.9 (cli-only)
@angular-devkit/build-optimizer 0.0.35
@angular-devkit/core 7.3.9 (cli-only)
@angular-devkit/schematics 7.3.9 (cli-only)
@angular/http 7.2.16
@schematics/angular 7.3.9 (cli-only)
@schematics/update 0.13.9 (cli-only)
rxjs 6.5.4
typescript 3.7.5
webpack 3.12.0
$ ionic info
Ionic:
Ionic CLI : 6.1.0 (C:\Users\KeniBarwick\AppData\Roaming\npm\node_modules@ionic\cli)
Ionic Framework : ionic-angular 3.9.9
@ionic/app-scripts : 3.2.4
Cordova:
Cordova CLI : 9.0.0 ([email protected])
Cordova Platforms : android 6.4.0
Cordova Plugins : no whitelisted plugins (7 plugins total)
Utility:
cordova-res : not installed
native-run : 0.2.9
System:
Android SDK Tools : 26.1.1 (C:\Users\KeniBarwick\AppData\Local\Android\Sdk)
NodeJS : v12.14.1 (C:\Program Files\nodejs\node.exe)
npm : 6.13.4
OS : Windows 10
It seems that we should use
window.plugins.OneSignal.startInit('appid','google api id').endInit();
instead of init
.
Inconsistent information between https://documentation.onesignal.com/docs/ionic-sdk and https://documentation.onesignal.com/docs/ionic-sdk-setup
Hi!
How call setSubscription method to set true/false via Ionic toggle?
Ex:
<li class="item item-toggle"> Push Notifications <label class="toggle toggle-dark"> <input type="checkbox" ng-model="notifications"> <div class="track"> <div class="handle"></div> </div> </label> </li>
By default all users receiving all notifications through OneSignal but when user switch to off notificztion not receiving?
This project branch (ionic_v1) is not detected with the latest ionic's CLI 5.2.1
I am trying to integrate OneSignal with my Ionic 2 App.
I installed the plugin, copied the code to app.ts, replaced the App ID and Google Project Number.
Now, when I try to run with ionic run android
, I am getting this error:
[ProjectRoot]/platforms/android/src/com/plugin/gcm/OneSignalPush.java:251: error: unreported exception JSONException; must be caught or declared to be thrown
OneSignal.setEmail(data.getString(0));
^
1 error
FAILEDFAILURE: Build failed with an exception.
- What went wrong:
Execution failed for task ':compileDebugJavaWithJavac'.Compilation failed; see the compiler error output for details.
Android Support Repository v25 and Google Repository v25 are installed.
Please help.
Hello,
I am getting below error while build apk on one-signal mentioned version ==> "ionic-native/onesignal": "^4.2.1", "onesignal-cordova-plugin": "^2.2.0"
[ERROR] An error occurred while running cordova build android (exit code 1):
ANDROID_HOME=C:\Users\XYZ\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\java\jdk1.8.0_31
Subproject Path: CordovaLib
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0.
Please use Task.doLast(Action) instead.
at build_au2kwlovcls6rtccq7cz9s5fi.run(D:\test\platforms\android\build.gradle:138)
The JavaCompile.setDependencyCacheDir() method has been deprecated and is scheduled to be removed in
Gradle 4.0.
Incremental java compilation is an incubating feature.
The TaskInputs.source(Object) method has been deprecated and is scheduled to be removed in Gradle
4.0. Please use TaskInputs.file(Object).skipWhenEmpty() instead.
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building
failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid
certification path to requested target
Failed to download any source lists!
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all dependencies for configuration ':_debugApkCopy'.
> Could not resolve com.android.support:support-v4:[26.0.0,26.1.0).
Required by:
project : > com.onesignal:OneSignal:3.6.1
> Could not resolve com.android.support:support-v4:[26.0.0,26.1.0).
> Failed to list versions for com.android.support:support-v4.
> Unable to load Maven meta-data from
https://maven.google.com/com/android/support/support-v4/maven-metadata.xml.
> Could not GET
'https://maven.google.com/com/android/support/support-v4/maven-metadata.xml'.
> sun.security.validator.ValidatorException: PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path
to requested target
> Could not resolve com.android.support:customtabs:[26.0.0,26.1.0).
Required by:
project : > com.onesignal:OneSignal:3.6.1
> Could not resolve com.android.support:customtabs:[26.0.0,26.1.0).
> Failed to list versions for com.android.support:customtabs.
> Unable to load Maven meta-data from
https://maven.google.com/com/android/support/customtabs/maven-metadata.xml.
> Could not GET
'https://maven.google.com/com/android/support/customtabs/maven-metadata.xml'.
> sun.security.validator.ValidatorException: PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path
to requested target
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more
log output.
BUILD FAILED
Total time: 29.031 secs
Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all dependencies for configuration ':_debugApkCopy'.
> Could not resolve com.android.support:support-v4:[26.0.0,26.1.0).
Required by:
project : > com.onesignal:OneSignal:3.6.1
> Could not resolve com.android.support:support-v4:[26.0.0,26.1.0).
> Failed to list versions for com.android.support:support-v4.
> Unable to load Maven meta-data from
https://maven.google.com/com/android/support/support-v4/maven-metadata.xml.
> Could not GET
'https://maven.google.com/com/android/support/support-v4/maven-metadata.xml'.
> sun.security.validator.ValidatorException: PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path
to requested target
> Could not resolve com.android.support:customtabs:[26.0.0,26.1.0).
Required by:
project : > com.onesignal:OneSignal:3.6.1
> Could not resolve com.android.support:customtabs:[26.0.0,26.1.0).
> Failed to list versions for com.android.support:customtabs.
> Unable to load Maven meta-data from
https://maven.google.com/com/android/support/customtabs/maven-metadata.xml.
> Could not GET
'https://maven.google.com/com/android/support/customtabs/maven-metadata.xml'.
> sun.security.validator.ValidatorException: PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path
to requested target
ionic info
cli packages: (C:\Users\XYZ\AppData\Roaming\npm\node_modules)
@ionic/cli-utils : 1.9.2
ionic (Ionic CLI) : 3.9.2
global packages:
Cordova CLI : 7.0.1
local packages:
@ionic/app-scripts : 2.1.4
Cordova Platforms : android 6.2.3
Ionic Framework : ionic-angular 3.6.0
System:
Node : v6.9.5
npm : 3.10.10
OS : Windows 10
With old version "ionic-native/onesignal": "^3.12.1","onesignal-cordova-plugin": "^2.1.2" , it's working fine.
Can anyone help me to solve build error with new version of one-signal?
First time install
cordova plugin add onesignal-cordova-plugin
Fetching plugin "onesignal-cordova-plugin" via plugin registry
npm http GET http://registry.cordova.io/onesignal-cordova-plugin
npm http 404 http://registry.cordova.io/onesignal-cordova-plugin
Error: 404 Not Found: onesignal-cordova-plugin
at RegClient. (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:268:14)
at Request.self.callback (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/npm/node_modules/request/index.js:148:22)
at Request.emit (events.js:110:17)
at Request. (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/npm/node_modules/request/index.js:876:14)
at Request.emit (events.js:129:20)
at IncomingMessage. (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/npm/node_modules/request/index.js:827:12)
at IncomingMessage.emit (events.js:129:20)
at _stream_readable.js:908:16
at process._tickCallback (node.js:355:11)
Second time install
cordova plugin add onesignal-cordova-plugin
Fetching plugin "onesignal-cordova-plugin" via npm
Installing "onesignal-cordova-plugin" for android
Error during processing of action! Attempting to revert...
Failed to install 'onesignal-cordova-plugin':Error: Uh oh!
ENOENT, no such file or directory '/Users/matthieu/mobile_projects/OneSignal-Ionic-Example/platforms/android/local.properties'
at Error (native)
at Object.fs.openSync (fs.js:500:18)
at Object.fs.readFileSync (fs.js:352:15)
at Object.createEditor (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/properties-parser/index.js:328:39)
at getProjectSdkDir (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/platforms/android.js:36:45)
at module.exports.framework.install (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/platforms/android.js:138:35)
at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/platforms/PlatformApiPoly.js:654:27
at Object.ActionStack.process (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/cordova-common/src/ActionStack.js:56:25)
at PlatformApiPoly.addPlugin (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/platforms/PlatformApiPoly.js:259:20)
at handleInstall (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:603:6)
Error: Uh oh!
ENOENT, no such file or directory '/Users/matthieu/mobile_projects/OneSignal-Ionic-Example/platforms/android/local.properties'
cordova plugin list:
onesignal-cordova-plugin 1.9.4 "OneSignal Push Notifications"
In app:
Failed to load resource: the server responded with a status of 404 (Not Found)
app.js:19 Uncaught TypeError: Cannot read property 'OneSignal' of undefined
Your library doesn't work in ionic lab which is what most ionic devs use, only on real device, kinda sucks.
Your check progression on your website only focus on eclipse and visual studio, talking about gradle (something that I have never seen):
As an ionic developer, this looks more 4-5 hours of incoming trouble.
I installed google play service through android, still not good.
If you want developers to use your product, start working on your documentation otherwise nobody is going to use your product ...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.