Sparkle checkForUpdatesInBackground places no request on webserver - objective-c

In my command-line application, when calling [[SUUpdater sharedUpdater] checkForUpdatesInBackground], project Sparkle does not place an HTTPS request on my webserver. I want a call to checkForUpdatesInBackground to succeed, so I know my setup is right. I am using an Nginx webserver over HTTPS, and view the logs of this server to make sure the appcast.xml file is being requested.
I have tried debugging the Sparkle framework, and found out after calling checkForUpdatesInBackground, the framework does call dispatch_async in here. This gave the following stack trace.
2018-12-20 06:46:46.037297-0800 MyApplication[28705:224144] Stack trace : (
0 ??? 0x00000001005a7b0e 0x0 + 4300897038
1 MyApplication 0x0000000100001af0 main + 0
2 Sparkle 0x000000010036a5f9 -[SUAppcast fetchAppcastFromURL:inBackground:completionBlock:] + 1625
3 Sparkle 0x0000000100372fff -[SUBasicUpdateDriver checkForUpdatesAtURL:host:] + 1423
4 Sparkle 0x00000001003aabe5 -[SUUpdater checkForUpdatesWithDriver:] + 773
5 Sparkle 0x00000001003aa41e -[SUUpdater checkForUpdatesInBackground] + 494
6 MyApplication 0x0000000100001b9f main + 175
7 libdyld.dylib 0x00007fff5ddd1085 start + 1
)
My Info.plist:
{
"SUAllowsAutomaticUpdates" = NO;
CFBundleIconFile = "myicon.icns";
CFBundleExecutable = MyApplication;
"SUAutomaticallyUpdate" = NO;
"SUScheduledCheckInterval" = 3600;
"SUEnableAutomaticChecks" = NO;
SUPublicEDKey = "0xe+xaH4VBOMIADOqOqBAZug/hnrCqBKUyCffx+8Qvw=";
SUFeedURL = "https://test.myurl.com/appcast.xml";
CFBundleVersion = "1.0.0.0";
"CFBundleShortVersionString" = "7.0";
CFBundleIdentifier = "nl.apps.myapp";
}
My Code:
int main(int argc, const char * argv[]) {
#autoreleasepool {
[[SUUpdater sharedUpdater] checkForUpdatesInBackground];
}
}
Sparkle does halt the termination of my application in order to wait for the request to end. On my webserver I do not see the appcast.xml being requested, and Sparkle does not show a window with any update information.

In my case, like Rengers pointed out, Sparkle does not work because it is a command-line tool. This means there exists no main loop where Sparkle depends on. Sparkle places some of its actions on the main event queue using dispatch_async, for example here in the source code.
To overcome this, I've made my command-line tool into a GUI, and now it all works fine.

Related

I am getting EXC_GUARD when launching app using NSTask launchedTaskWithLaunchPath

Faulting code:
myTask = [NSTask launchedTaskWithLaunchPath: appPath arguments: initArray];
Where myTask is a global static NSTask* myTask = NULL; and initArray is a global static NSMutableArray *initArray = NULL; and appPath is a local NSString*
Exception Type: EXC_GUARD
Exception Codes: 0x4000000200000001, 0x326e91a2a5c769eb
Exception Subtype: GUARD_TYPE_FD, id=0x326e91a2a5c769eb, fd=1, flavor=0x00000002 (DUP)
Top of stack:
0 libsystem_kernel.dylib 0x00007fff2033848e dup + 10
1 com.apple.Foundation 0x00007fff2126df14 -[NSConcreteTask launchWithDictionary:error:] + 2491
2 com.apple.Foundation 0x00007fff21294c89 +[NSTask launchedTaskWithLaunchPath:arguments:] + 146
This issue is not reproducible and this code has not been changed since years. Please suggest some ways to debug this.
Additional info: Parent app which is launching this task has its output stream and error stream set to a log file but both the streams have been set after this app gets launched.

Issue with obtaining the offline messages using openfire server

Offline messages are not delivering to the user when the person avails.
DelayInformation info = (DelayInformation)message.getExtension("x","jabber:x:delay");
returns null.
when i iterate the collection of message.getExtensions() , i get delay urn:xmpp:delay.
can anyone explain on this.
I'm using smack and smackx.jar. Though the smackx.jar has smack.providers it's not taken into account.
some suggested to use urn:xmpp:delay ,which results in class cast exception.
DelayInformation inf = (DelayInformation)message.getExtension("delay","urn:xmpp:delay");
Exception:
java.lang.ClassCastException: org.jivesoftware.smack.packet.DefaultPacketExtension
if this is for android by using the Smack Library try this:
ExtensionElement delay = message.getExtension("urn:xmpp:delay");
if(message.getExtension("urn:xmpp:delay") != null){
Log.i("RECVEIVED", "delay 1: " + delay.toXML());
Log.i("RECVEIVED", "delay 2: " + delay.getNamespace());
Log.i("RECVEIVED", "delay 3: " + delay.getElementName());
}
Log output:
I/RECVEIVED: delay 1: <delay xmlns='urn:xmpp:delay' stamp='2017-07-31T04:09:23.224+00:00' from='81.89.100.197'></delay>
I/RECVEIVED: delay 2: urn:xmpp:delay
I/RECVEIVED: delay 3: delay
this is another possibillity:
DelayInformation delayInformation = DelayInformation.from(message);
if (delayInformation != null) {
Log.i("RECVEIVED", "delay 1 : " + delayInformation.getStamp());
Log.i("RECVEIVED", "delay 2 : " + delayInformation.getStamp().getTime());
}
Log output:
I/RECVEIVED: delay 1: Mon Jul 31 06:08:58 GMT+02:00 2017
I/RECVEIVED: delay 2: 1501474138319
Good Luck
According to the document:
https://github.com/igniterealtime/Smack/wiki/Smack-4.2-Readme-and-Upgrade-Guide
f you are developing with smack 4.2 on java 7, you need the following dependencies to make it work:
compile "org.igniterealtime.smack:smack-java7:4.2.0"
// Optional for XMPPTCPConnection
compile "org.igniterealtime.smack:smack-tcp:4.2.0"
// Optional for XMPP-IM (RFC 6121) support (Roster, Threaded Chats, …)
compile "org.igniterealtime.smack:smack-im:4.2.0"
// Optional for XMPP extensions support
compile "org.igniterealtime.smack:smack-extensions:4.2.0"

How to retrieve vCard in xmpp , which delegate method and flow is use for get vCard in cocoa os x app?

I have implement xmpp framework in my cocoa os x application. currently am working on vCard. i have done work on set all required field's data of login user and it stored successfully, but i have no proper solution for how to get login user's stored vcard and am not aware of it. Please give me solution for this problem. i have been suffering for this from last 3 days. help me as soon as
Thanx in advance
i have used below code to set vCard field
dispatch_queue_t queue = dispatch_queue_create("queue", DISPATCH_QUEUE_PRIORITY_DEFAULT);
dispatch_async(queue, ^
{
XMPPvCardCoreDataStorage *xmppvCardStorage = [XMPPvCardCoreDataStorage sharedInstance];
XMPPvCardTempModule *xmppvCardTempModule = [[XMPPvCardTempModule alloc] initWithvCardStorage:xmppvCardStorage];
[xmppvCardTempModule activate:[self xmppStream]];
XMPPvCardTemp *myvCardTemp = [xmppvCardTempModule myvCardTemp];
if (!myvCardTemp)
{
NSXMLElement *vCardXML = [NSXMLElement elementWithName:#"vCard" xmlns:#"vcard-temp"];
XMPPvCardTemp *newvCardTemp = [XMPPvCardTemp vCardTempFromElement:vCardXML];
[newvCardTemp setName:#"vCard"];
[newvCardTemp setNickname:lbl.stringValue];
[newvCardTemp setFormattedName:#"abc"];
[newvCardTemp setDesc:lbl_abt.stringValue];
[xmppvCardTempModule updateMyvCardTemp:newvCardTemp];
}
else
{
[myvCardTemp setName:#"vCard"];
[myvCardTemp setNickname:lbl.stringValue];
[myvCardTemp setFormattedName:#"abc"];
[myvCardTemp setDesc:lbl_abt.stringValue];
[xmppvCardTempModule updateMyvCardTemp:myvCardTemp];
}
});
}
And i also tried below code to retrieve vCard
/* XMPPvCardTempModule *xmppvCardTempModule;
XMPPvCardTemp *vCard =[xmppvCardTempModule vCardTempForJID:[XMPPJID jidWithString:#"xxxx"] shouldFetch:YES];
NSLog(#"V CARD :%#",vCard.nickname);*/
XMPPvCardCoreDataStorage* xmppvCardStorage = [XMPPvCardCoreDataStorage sharedInstance];
XMPPvCardTempModule* m = [[XMPPvCardTempModule alloc]initWithvCardStorage:xmppvCardStorage];
[m fetchvCardTempForJID:[XMPPJID jidWithString:#"xxxx"]ignoreStorage:YES];
NSLog(#"%#",xmppvCardStorage.description);
Please suggest me proper way to solve this problem :

FFMpeg Out of sync audio/video in iOS application

The app saves the camera output into a mov. file, then turn it to flv format that sent by AVPacket to rtmp server.
It switch every time between two files, one is written by the camera output and the other one is sent.
My problem is that the audio/video is getting out of sync after a while.
The first buffer sent is allways 100% sync but after awhile it get messed.
I belive its a DTS-PTS problem..
if(isVideo)
{
packet->stream_index = VIDEO_STREAM;
packet->dts = packet->pts = videoPosition;
videoPosition += packet->duration = FLV_TIMEBASE * packet->duration * videoCodec->ticks_per_frame * videoCodec->time_base.num / videoCodec->time_base.den;
}
else
{
packet->stream_index = AUDIO_STREAM;
packet->dts = packet->pts = audioPosition;
audioPosition += packet->duration = FLV_TIMEBASE * packet->duration / audioRate;
//NSLog(#"audio position = %lld", audioPosition);
}
packet->pos = -1;
packet->convergence_duration = AV_NOPTS_VALUE;
// This sometimes fails without being a critical error, so no exception is raised
if((code = av_interleaved_write_frame(file, packet)))
{
NSLog(#"Streamer::Couldn't write frame");
}
av_free_packet(packet);
You can research this sample: http://unick-soft.ru/art/files/ffmpegEncoder-vs2008.zip
But this sample is for Windows.
In this sample I use pts only for audio stream:
if (pVideoCodec->coded_frame->pts != AV_NOPTS_VALUE)
{
pkt.pts = av_rescale_q(pVideoCodec->coded_frame->pts,
pVideoCodec->time_base, pVideoStream->time_base);
}
I was experiencing a similar issue when switching out the AVAssetWriters, and noticed that it went way if I only started using the new AVAssetWriter when I got a video sample
https://medium.com/#brandon.kobel/ios-seamless-video-chunks-4383a5a3a874

Zend Framework 2 + Doctrine: try to authenticate

I´m trying to authenticate in Zend Framework 2 + Doctrine:
I think i added everything which I need to Module.php + module.config.php
In my Controller I do:
$authService = $this->getServiceLocator()->get('Zend\Authentication\AuthenticationService');
$adapter = $authService->getAdapter();
$adapter->setIdentityValue($formdata['username']);
$adapter->setCredentialValue($formdata['password']);
$authResult = $adapter->authenticate();
It works until $adapter->authenticate();
Error is:
Warning: class_parents(): Class does not exist and could not be loaded
in
/.../doctrine/common/lib/Doctrine/Common/Persistence/Mapping/RuntimeReflectionService.php
on line 40
public function getParentClasses($class)
{
return class_parents($class); //Line 40
}