Skip to content

Instantly share code, notes, and snippets.

View milankamilya's full-sized avatar
👋
open to work

Milan Kamilya milankamilya

👋
open to work
View GitHub Profile
var apn = require('apn');
var options = {
token: {
key: './keys/AuthKey_XXXXXXXXXX.p8',
keyId: "XXXXXXXXXX",
teamId: "XXXXXXXXXX"
},
production: false
};
function removePushNotification(body, prevNotificationID){
var notification = new apn.Notification();
notification.expiry = Math.floor(Date.now() / 1000) + 60; // Expires 1 min from now.
notification.badge = 1; //you can update the count as it required
notification.alert = body.alertMessage;
// for Silent Notification
notification.sound = "";
@milankamilya
milankamilya / Musiclist.json
Created December 1, 2019 05:13
Sample JSON
{
"songs" : [ {
"artist" : "The Tallest Man on Earth",
"img_url" : "http://fireflygrove.com/songnotes/images/artists/TheTallestManOnEarth.jpg",
"title" : "1904 up down",
"web_url" : "http://www.songnotes.cc/songs/78-the-tallest-man-on-earth-1904",
"year" : "2012"
}, {
"artist" : "Dave Matthews",
"img_url" : "http://fireflygrove.com/songnotes/images/artists/DaveMatthews.jpg",
@milankamilya
milankamilya / utility.m
Last active March 1, 2021 14:24
AWS S3 with Transfer Utility in Objective C
- (void) uploadFileURL: (NSURL *) fileURL key: (NSString *) key content: (NSString *) contentType {
// TODO: TRANSER MANAGER NEED TO BE UPDATED BASED REGISTER KEY
AWSS3TransferUtility *transferUtility = [AWSS3TransferUtility S3TransferUtilityForKey:AWSS3_TRANSFER_MANAGER_CONFIGURATION_LMS];
@weakify(self)
//Create the completion handler for the transfer
AWSS3TransferUtilityUploadCompletionHandlerBlock completionHandler = ^(AWSS3TransferUtilityUploadTask *task, NSError *error) {
dispatch_async(dispatch_get_main_queue(), ^{
@strongify(self)