Error message when initializing EKEventStore on OS X 10.10 - macos

I would like to programmatically create a new reminder in my app that runs on Mavericks.
As written in the Mac Developer Library, I tried to use the method initWithAccessToEntityTypes to initialize an event store:
On OS X, use initWithAccessToEntityTypes: instead of the default init
method. Acceptable entity types are EKEntityMaskEvent for events and
EKEntityMaskReminder for reminders.
However, Xcode complained that this method is deprecated in OS X 10.9.
When using it anyway, I get the following error message:
[com.apple.calendar.store.log] [Tried to connect to XPC persistence,
but connection was invalidated, retrying...]
[com.apple.calendar.store.log] [Retried too many times, giving up.]
[com.apple.calendar.store.log] [Couldn't start the XPC store server.
[Error Domain=CalPersistenceCreationDomain Code=3 "Could not create
XPC connection to the CalendarAgent, connection interrupted or
invalidated more than 5 times" UserInfo=0x6080002698c0
{NSLocalizedDescription=Could not create XPC connection to the
CalendarAgent, connection interrupted or invalidated more than 5
times}]] [com.apple.calendar.agentLink.xpc] [Creating a remote proxy
object for com.apple.CalendarAgent.proxy resulted in an invalid
connection. The connection will be removed. Error
Domain=NSCocoaErrorDomain Code=4099 "Couldn’t communicate with a
helper application." (The connection to service named
com.apple.CalendarAgent.proxy was invalidated.)
UserInfo=0x600000475e80 {NSDebugDescription=The connection to service
named com.apple.CalendarAgent.proxy was invalidated.} (
I've searched using Google, StackOverflow, and the Mac developer forums but I could not find a way to make it work.
What can I do to initialize the event store in order to add a new reminder?

The app was sandboxed. I changed the sandbox setting in Xcode (see screenshot) and now it works. Also, it seems that it is now possible to initialize a store simply by using:
self.ekEventStore = [[EKEventStore alloc] init];

Related

Do XPC errors imply failure to communicate with a macosx daemon?

I am having a problem where a mac binary that interacts with CoreBluetooth fails as CBCentralManager reports "unsupported". I have already ensured entitlements, codesigning, and Security & Privacy are set properly. When I do verbose bluetooth logging I see the following:
[com.apple.bluetooth:CoreBluetooth] Sending XPC message 1: {
kCBMsgArgName = "TestApp";
kCBMsgArgOptions = {
kCBInitOptionRestoreIdentifier = SuperUnique;
kCBInitOptionShowPowerAlert = 1;
kCBManagerPrivacySupported = 0;
};
kCBMsgArgType = 0;
kCBMsgArgVersion = 20161219;
}
Default 0x0 152 0 bluetoothd: [com.apple.bluetooth:Server.XPC] Received XPC message "CBMsgIdCheckIn" from session ""
**Error 0x0 152 0 bluetoothd: [com.apple.bluetooth:Server.XPC] No XPC object for key: kCBMsgArgType**
My question is not about the permissions for Bluetooth and more about how severe this error is or if it is a red herring. Does this mean my IPC message to bluetoothd failed to be delivered? If so, how would XPC issues like this normally occur? SDK version mismatch? Is there any way to get more debugging information?
I upgraded from XCode 12.5.0 to 13.2.1 and the problem is resolved. It seems to have been an SDK mismatch and therefore the XPC messages were not being deserialized properly.
It would be good to get a more robust answer of how XPC messages work but I have not found a lot of resources on that. In lieu of that I can at least say this has solved the problem.

Error during initializing the Scanner of mPop Printer

I am developing a point of Sale Application in which there is requirement of Bluetooth connectivity which printer and scanner. I am using star Printer. I am getting following error randomly when scanner is being initialized.
ERROR - opening session
ERROR - /SourceCache/ExternalAccessory/ExternalAccessory-288.20.7/EASession.m:-[EASession dealloc] - 141 unable to close session for _accessory=0x16768100 and sessionID=65536
Thanks,
Ratneshwar
I had the same bug, so finally i fixed it downloading the mPOP utility and changing in the bluetooth configuration the Name port.
It isnt a complete solution, but while star micronics fix the problem can works to the customers.
EDIT: If you have implemented both sdks StarIO.framework and StarIO_extension.framework and you are using the barcode lector always in your app you should use the method [_starIoExtManager.lock lock]; before you try to get the connection of the port and after you do that and close the port, use [_starIoExtManager.lock unlock];

Chromecast sender application error when requesting new session

I have an unpublished custom receiver app, and I am unable to cast to it from my web player sender app in chrome. I do get the receiver "available" message upon initialization of cast api, but when I click on the cast button in player and select the chromecast device from drop down menu in extension, the TV screen goes black and few seconds later I get onError method called with following error:
{code: "channel_error", description: "Error: Timeout", details: null}
The casting works fine when using default media receiver. Also, I do not see any network traffic coming from chromecast device in my server console log, which means that chromecast is not fetching the receiver application.
I made sure of the following:
The Chromecast dongle is registered as Cast Receiver device in Cast
Developer console.
My macbook has NodeJS server running to serve the
receiver application and the "Receiver Application URL" in cast
developer console is correctly pointing to server running on my
macbook.
The chromecast and my macbook both are on same network, with
valid 192.168.x.x IP addresses.
I found another thread discussing this error Chromecast sample sender application CastHelloText-chrome ends with error when trying to get session, but the suggestions provided there dont seem to apply to my situation.
I was able to resolve this particular error by restarting the chromecast device. I tried it on two separate occasions and both times the issue went away once the device was restarted. I can't explain how it worked, but it did the job. If someone can explain what is the cause of this particular error and why restarting fixes it, I will accept that answer.

Unable to Open SCOAudio connection with phone

I am trying to use IOBluetooth framework on OS X 10.8.2 to connect with the bluetooth enabled phones emulating computer as a hands free device. I can successfully make a connection with the phone and phone can recognise the connection as a HandsFree connected to the phone.
But when I try to make a call with the phone and want to send the audio to the mac (by selecting the source as handsfree), the audio never reaches the computer.
As at this point the bluetooth framework tries to open a SCO Audio connection with the device, but the connection establishment is never successful and I get the error code 0x0D status code in scoConnectionOpened status.
I am using IOBluetoothAddSCOAudioDevice function to attach the SCO Audio device with bluetooth device and it is always successful.
//btDevice is paired
res=IOBluetoothAddSCOAudioDevice((IOBluetoothDeviceRef) btDevice,NULL);
if(res != kIOReturnSuccess)
{
self.error.title = [NSString stringWithFormat:
#"Could not attach the Audio device. Try paring device again"];
}
The console log says
24/11/2012 4:02:13.000 PM kernel[0]: [SendHCIRequestFormatted] ###
ERROR: [0x0428] (Setup Synchronous Connection) -- Send request failed
(err = 0x000D (kBluetoothHCIErrorHostRejectedLimitedResources))
24/11/2012 4:02:13.000 PM kernel[0]: REQUIRE_NO_ERR failure: 0xd -
file:
/SourceCache/IOBluetoothFamily_kexts/IOBluetoothFamily-4090.4.33/Core/Family/Drivers/IOBluetoothSCOAudioDriver/IOBluetoothSCOAudioDevice.cpp:872
Although console log says limited resources but I have tried it with multiple phones having their batteries full.
I am stumped on this and just thinking if I need to do any thing special or different?
Thanks in advance for much appreciated help.
This error ("Connection Rejected due to Limited resource") typically happens when a T2 request is sent to a T1-only SCO listener. If you read the patch notes to version 5 you can get a discussion about this problem linux-bluetooth v5 patch notes

How to use notificationconf?

I have read THIS tutorial about creating Push nodes and posting/subscribing to notifications.
The only problem I have met is that it seems that notificationconf unable to create that node...
My first question: are nodename (parameter of notificationconf tool) and notificationName (NSString which I use from app) the same things?
Second:
notificationconf createnode push.example.com BFMyTestPushhNotification beefon
Enter password: // password from Open Directory for user beefon - it is Admin of the 10.6 server
2010-01-24 13:24:58.916 notificationconf[15221:903] created XMPP session
2010-01-24 13:24:58.931 notificationconf[15221:903] Connecting to push.example.com:5222 with user com.apple.notificationuser#push.example.com/TestPubsub, security = 2 ...
2010-01-24 13:24:59.130 notificationconf[15221:903] sessionCallback (event 1)
2010-01-24 13:24:59.130 notificationconf[15221:903] Session stopped (event 1)
What I do wrong?
And posting notification from app does nothing...
Thanks for any help!
I've been trying to use Snow Leopard Server's Push Notification service with a custom application based on XMPP Publish–Subscribe. I struggled to create a node but finally figured it out.
Track down the password for the service account com.apple.notificationuser. You can find it, for example, in /private/etc/dovecot/notify/notify.plist.
Connect to your push notification server with JID com.apple.notificationuser#your-chat-server-hostname.com and that password.
Create nodes the normal way. In XMPPFramework it's like this:
XMPPJID *serviceJID =
[XMPPJID jidWithString:#"pubsub.your-chat-server-hostname.com"];
XMPPPubSub *xmppPubSub = [[XMPPPubSub alloc] initWithServiceJID:serviceJID];
[xmppPubSub createNode:#"pubsub.your-chat-server-hostname.com`
withOptions:nil];
The server creates the node. It responds with an iq, but not the one the spec requires. It does send a compliant error if the node already exists.
<iq xmlns="jabber:client"
to="com.apple.notificationuser#your-chat-server-hostname.com/..."
from="pubsub.your-chat-server-hostname.com"
id="...:create_node" type="result"/>
Connect using that same user to publish your updates.
I was never able to get notificationconf to work.
Notifications are easy to use on the same node, but harder across a network. Especially, I don't think too many people are actually using it, as Google search results are scarce :) Now, regarding your questions:
For 1: yes, you need to have matching nodename and notificationName. The man page says so (although not crystal-clear):
createnode hostname nodename username
Creates a node on the server to send notifications using. Before
a client can subscribe to notifications with a given name, the
server must be configured with a node with a matching name.
So, first you have to create the node, then you can listen to notifications of a given name. Otherwise, you don't get the notifications.
For 2: I get this error when there is no XMMP daemon running (i.e. port 5222 is closed). Is that port open for you? (check the output of nmap -p 5222 push.example.com).

Resources