Skip to content

Instantly share code, notes, and snippets.

<html>
<head>
<script>
if (location.search.indexOf("?url=") == 0)
window.location.replace(location.search.substring(5));
</script>
</head>
<body></body>
</html>
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.adquizition.adphenom" android:installLocation="preferExternal" android:versionCode="1" android:versionName="1.0">
<supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" />
<permission android:name="com.adquizition.adphenom.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="com.adquizition.adphenom.permission.C2D_MESSAGE" />
<application android:icon="@drawable/app_icon" android:label="@string/app_name" android:debuggable="true">
<activity android:name="com.onevcat.uniwebview.AndroidPlugin" android:label="@string/app_name" android:hardwareAccelerated="true" android:windowSoftInputMode="adjustResize" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreen
@jkasten2
jkasten2 / plugin.xml
Created November 5, 2015 22:30
onesignal-cordova-plugin-pgb-compat without amazon
<?xml version="1.0" encoding="UTF-8"?>
<plugin xmlns="http://www.phonegap.com/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
id="onesignal-cordova-plugin-pgb-compat"
version="1.9.1">
<name>OneSignal Push Notifications PGB Compat</name>
<author>Josh Kasten</author>
<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, A/B test, and automate notifications that you send.</description>
@jkasten2
jkasten2 / logcat_of_onesignal_gcm_notifications_in_different_app_states.java
Last active May 4, 2016 21:35
Logcat from device of an app closing normally vs "Force Closed" and how it affects notifications.
// Logcat from device of an app closing normally vs "Force Closed" and how it affects notifications.
// com.onesignal.example app running with the OneSignal 2.1.2 SDK on a Android 6.0.1 device
/** 1.1 Swiping away example app from the Recent Apps list **/
02-27 13:39:29.854 15326-15326/com.onesignal.example D/OneSignal: onActivityDestroyed: com.onesignal.example.MainActivity
02-27 13:39:29.855 15326-15326/com.onesignal.example D/OneSignal: curActivity is NOW: null
02-27 13:39:29.863 15326-15326/com.onesignal.example I/OneSignal: GetUnsentActiveTime: 25
02-27 13:39:29.863 15326-15326/com.onesignal.example I/OneSignal: SaveUnsentActiveTime: 27
02-27 13:39:29.873 937-3666/? I/ActivityManager: Killing 15326:com.onesignal.example/u0a261 (adj 16): remove task
02-27 13:39:29.964 937-3673/? D/GraphicsStats: Buffer count: 13
using System.Linq;
using System.Text;
using System.IO;
using System.Net;
// TODO: Replace YOUR_ONESIGNAL_REST_API_KEY with your key.
// TODO: Replace YOUR_ONESIGNAL_APP_ID with your app id.
namespace ConsoleApplication3
package com.onesignal.example;
import android.app.Application;
import android.util.Log;
import com.onesignal.OneSignal;
import org.json.JSONObject
@jkasten2
jkasten2 / README.MD
Last active June 13, 2020 01:10
Use a local OneSignal SDK .aar file with Android Studio

Using a local onesignal.aar file

  1. Create a libs folder under the app directory in your project.
  2. Place onesignal.aar in the newly created app/libs directory.
  3. Open your project's root build.gradle file and add the folowing under repositories {...}.
flatDir {
  dirs 'libs'
}
  1. Open your app/build.gradle.
@jkasten2
jkasten2 / AppDelegate.m
Last active November 10, 2016 08:06
OneSignal2.2.2_Swizzle_testing
/**
* Modified MIT License
*
* Copyright 2016 OneSignal
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@jkasten2
jkasten2 / DebugClasses.m
Last active November 23, 2016 00:22
Some Objective-c debug functions
void DumpProtocols(Class cls) {
unsigned count;
Protocol * __unsafe_unretained * pl = class_copyProtocolList(cls, &count);
for (unsigned i = 0; i < count; i++)
NSLog(@"Class %@ implements protocol <%s>", cls, protocol_getName(pl[i]));
free(pl);
// Singleton pattern - static way to get instance
// Example 1 - Basic
class ExampleClassName {
// A "companion object" is required to make "static" methods / properites.
companion object {
// Property - private stetter, internal getter
// @JvmStatic - Only required if used outside of Kotlin
@JvmStatic lateinit var instance: Context private set
}
}