– Use photos framework instead of ALAsset library. – You will get all albums in smartAlbums & userCollections. – If you want the albums which contain at least 1 photos refer below code. – This code will work on swift. var arrAlbums: [PHCollection]! = Array() …
2017
Openfire offline notification through PHP
Question We have installed Openfire 3.10.2 on Ubuntu 12.04. Chat is working fine and for offline message management I have installed the CallbackOnOfflineplugin. When the recipient is offline, a url is called. The plugin loads the url from the plugin.callback_on_offline.url property, adds ‘to’ and ‘from’ …
How to display ticking clock with differnce time from specific time (hours , minutes and seconds) in AngularJS?
Directive code : app.directive(‘clock’, [‘dateFilter’, ‘$timeout’, function (dateFilter, $timeout) { return { restrict: ‘E’, scope: { format: ‘@’, }, link: function (scope, element, attrs) { var updateTime = function () { //GET UTC DATE TIME BY USING MOMENT JS var now = moment(new Date()).utc().format(‘YYYY-MM-DD HH:mm:ss’) …
Get last Last Logout details openfire using REST API
Problem :- We do have functionality for offline group push notification from server end. Application is open and go to the group message tab. Now send a message to the group so, other users of group will get message i sent. By closing (kill or …
Google calendar event which repeats yearly
Problem :- we have successfully managed to add event to google calendar through php api client, but what i want is to make that event repeat every year , such as company anniversary etc, i didn’t find that in the google documentation also ,so what …
Group Joining Xmpp : Getting all messages every-time after joined group.
Hello, After deep look on group joining method of XMPP, we found one solution is describe here: let objXmppStream = XMPPStream() let objGroup = “YourGroupname@YourXMPPHOST” let roomStorage = XMPPRoomMemoryStorage() let roomJID = XMPPJID.jidWithString(objGroup) let objXmppChatRoom = XMPPRoom(roomStorage: roomStorage, jid: roomJID, dispatchQueue: dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0)) objXmppChatRoom.activate(XMPPHelper.sharedInstance.objXmppStream) objXmppChatRoom.fetchConfigurationForm() let …
onvert timestamp to pubnub timestamp of 17-digit precision unix time (UTC)
Problem :- We are trying to convert timestamp 2016-02-11 03:31:18 to pubnub timestamp of 17-digit precision unix time (UTC) something like 13406746780720711 given in reference url given by pubnub function parseDateTime(s) { var b = s.split(/\D/); return new Date(b[0],b[1]-1,b[2],b[3],b[4],b[5]) } date = new Date(parseDateTime(“2015-02-11 02:10:54”) …
Openfire: Add user subscription status as “both”
Problem : Issue when i add user using RestApi include “vendor/autoload.php”; $api = new GidkomOpenFireRestApiOpenFireRestApi; $api->secret = “mySecretKey”; $api->host = “HostName”; $api->port = “9090”; $api->useSSL = false; $api->plugin = “/plugins/restapi/v1″; // plugin For adding user to Roster i am using following code $jid=”xyz@domainname”; //Add to …
Use closure when doing some heavy operation in app
its better to use closure because its work in background but it stores strong reference of object so whenever operation finish you get data back and also after that you make an operation on data. Example code func retrivingData(completion : (()->())){ // do opearation completion(data) } …
AWS: Useful terminal commands
SSH connection using PEM file $ ssh -l ABC.pem username@53.0.111.225 IMPORT mysql db to AWS from local system $ mysql -u username -h hostname -p dbname < dbfile.sql EXPORT mysql db $ mysqldump -h hostname -u username -p db > dbfile.sql Transfer file via ssh …