This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Notifications } from 'expo'; | |
import { AppState, Platform } from 'react-native'; | |
import { Component } from 'react'; | |
const isIos = Platform.OS === 'ios'; | |
export class NotificationHandler extends Component { | |
state = { | |
appState: AppState.current | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Examples\Transmissions; | |
require dirname(__FILE__).'/../bootstrap.php'; | |
use SparkPost\SparkPost; | |
use GuzzleHttp\Client; | |
use Http\Adapter\Guzzle6\Client as GuzzleAdapter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module('myapp.services', []) | |
.service('LocationService', function ($cordovaGeolocation) { | |
return { | |
askLocationPermission: function (successCallback, errorCallback) { | |
var permissions = cordova.plugins.permissions; // could not find a better way to access cordova; it's not in $window | |
permissions.requestPermission(permissions.ACCESS_COARSE_LOCATION, successCallback, errorCallback); | |
} | |
getCoords: function () { | |
// omitted for brevity |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LocationService.askLocationPermission() | |
.then(LocationService.getCoords) | |
.then(function(coords) { | |
console.log(coords); | |
}) | |
.catch(function(err) { | |
console.log(err); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module('myapp.services', []) | |
.service('LocationService', function ($cordovaGeolocation, $q) { | |
return { | |
askLocationPermission: function () { | |
var permissions = cordova.plugins.permissions, // could not find a better way to access cordova; it's not in $window | |
deferred = $q.defer(); | |
permissions.requestPermission(permissions.ACCESS_COARSE_LOCATION, function(result) { | |
deferred.resolve(); | |
}, function(err) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LocationService.getCoords() | |
.then(function (coords) { | |
console.log(coords); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class HelloMailer < ApplicationMailer | |
def welcome(user) | |
headers 'X-MSYS-API': { "options": { "open_tracking": true, "click_tracking": true } }.to_json | |
mail(to: user.email, subject: 'Welcome!') | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
"countryA", | |
"countryB" | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'https://rubygems.org' | |
gem 'sparkpost' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/initializers/email_settings.rb | |
ActionMailer::Base.smtp_settings = { | |
user_name: 'SMTP_Injection', | |
password: 'Any API Key with Send via SMTP permission', | |
address: 'smtp.sparkpostmail.com', | |
port: 587, | |
enable_starttls_auto: true, | |
format: :html, | |
from: '[email protected]' |
NewerOlder