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

SecurityException: Permission denied (missing INTERNET permission?) #1

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
12 changes: 7 additions & 5 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
</config-file>

<config-file target="AndroidManifest.xml" parent="/manifest">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.VIBRATE"/>
Expand All @@ -56,12 +57,13 @@
<service android:name="ventures.paramount.phonegap.notificationhub.GCMIntentService" />
</config-file>

<framework src="com.android.support:support-v4:+" value="gradle" />

<source-file src="src/android/libs/gcm.jar" target-dir="libs/" />
<source-file src="src/android/libs/android-support-v13.jar" target-dir="libs/" />
<source-file src="src/android/libs/google-play-services.jar" target-dir="libs/" />
<source-file src="src/android/libs/notification-hubs-0.1.jar" target-dir="libs/" />

<source-file src="src/android/ventures/paramount/phonegap/notificationhub/CordovaGCMBroadcastReceiver.java" target-dir="src/ventures/paramount/phonegap/notificationhub/" />
<source-file src="src/android/libs/google-play-services.jar" target-dir="libs/" />
<source-file src="src/android/libs/notification-hubs-0.1.jar" target-dir="libs/" />

<source-file src="src/android/ventures/paramount/phonegap/notificationhub/CordovaGCMBroadcastReceiver.java" target-dir="src/ventures/paramount/phonegap/notificationhub/" />
<source-file src="src/android/ventures/paramount/phonegap/notificationhub/GCMIntentService.java" target-dir="src/ventures/paramount/phonegap/notificationhub/" />
<source-file src="src/android/ventures/paramount/phonegap/notificationhub/NotificationHubHandlerActivity.java" target-dir="src/ventures/paramount/phonegap/notificationhub/" />
<source-file src="src/android/ventures/paramount/phonegap/notificationhub/NotificationHubPlugin.java" target-dir="src/ventures/paramount/phonegap/notificationhub/" />
Expand Down
Binary file removed src/android/libs/android-support-v13.jar
Binary file not shown.
9 changes: 7 additions & 2 deletions src/windows/NotificationHubProxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,12 @@ module.exports = {
notification = e.badgeNotification.content;
notification.notificationTypeName = "Badge";
break;
case notificationType.raw:
notification = e.rawNotification.content;
notification.notificationTypeName = "Raw";
break;
}
pushNotificationCallback(notification);
pushNotificationCallback(notification, e);
} catch (ex) {}
e.cancel = true;
}
Expand All @@ -61,7 +65,8 @@ module.exports = {
regInfo.registrationId = result;
regInfo.channelUri = notificationChannel.uri;
regInfo.notificationHubPath = notificationHubPath;

regInfo.event = 'registerApplication';

success(regInfo);
}, fail);

Expand Down
6 changes: 2 additions & 4 deletions www/NotificationHub.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ NotificationHub.prototype.registerApplicationAsync = function (tags) {
var me = this,
globalNotificationHandlerName = 'NotificationHub_onNotificationReceivedGlobal';
// global handler that will be called every time new notification is received
window[globalNotificationHandlerName] = function (msg) {
window[globalNotificationHandlerName] = function (msg, receivedData) {
// if handler attached
if (me.onPushNotificationReceived != null) {
me.onPushNotificationReceived(msg)
me.onPushNotificationReceived(msg, receivedData)
}
};

Expand All @@ -69,8 +69,6 @@ NotificationHub.prototype.registerApplicationAsync = function (tags) {
if (result && result.event == 'registerApplication') {
delete result.event; // not required
deferral.resolve(result);
} else { //push notification
window[globalNotificationHandlerName](result);
}
},

Expand Down