Hello I ma trying to connect to IPoyntAccessoryManager to get cashdrawer working withing usb trigger
Here is what I am trying to do:
I am creating helper like this:
accessoryProviderServiceHelper = new AccessoryProviderServiceHelper(activity, new AccessoryProviderServiceHelper.AccessoryManagerConnectionCallback() {
@Override
public void onConnected(AccessoryProviderServiceHelper accessoryProviderServiceHelper) {
}
@Override
public void onDisconnected(AccessoryProviderServiceHelper accessoryProviderServiceHelper) {
}
});
and then
when I am calling acessoryManager.getAccessoryProviders, I get message that POYNT services has stopped
IPoyntAccessoryManager acessoryManager = accessoryProviderServiceHelper.getAccessoryServiceManager();
try {
acessoryManager.getAccessoryProviders(new AccessoryProviderFilter(AccessoryType.CASH_DRAWER), new IPoyntAccessoryManagerListener() {
@Override
public void onError(PoyntError poyntError) throws RemoteException {
}
@Override
public void onSuccess(List<AccessoryProvider> list) throws RemoteException {
}
@Override
public IBinder asBinder() {
return null;
}
});
}
catch (Throwable e)
{
Logger.error(e);
}
Logcat messages
10-05 07:46:23.133 29870-29870/com.ehopper.pos W/ContextImpl: Implicit intents with startService are not safe: Intent { act=co.poynt.os.services.v1.IPoyntAccessoryManager } android.content.ContextWrapper.bindService:517 co.poynt.os.util.AccessoryProviderServiceHelper.bindAccessoryManager:74 co.poynt.os.util.AccessoryProviderServiceHelper$2.onServiceDisconnected:179
10-05 07:46:23.165 29870-29870/com.app.pos D/PoyntManager: PoyntBusinessService has unexpectedly disconnected
10-05 07:46:23.165 29870-29870/com.app.pos E/TransactionTestActivity: PoyntSessionService has unexpectedly disconnected
10-05 07:46:23.165 29870-29870/com.app.pos D/PoyntManager: onServiceDisconnected
10-05 07:46:23.165 29870-29870/com.app.pos D/PoyntManager: IPoyntSecondScreenService has unexpectedly disconnected
10-05 07:46:23.165 29870-29870/com.app.pos D/PoyntManager: PoyntCustomerService disconnected
I am getting following exception in logcat
10-06 03:48:39.740 31706-31706/co.poynt.services E/AndroidRuntime: FATAL EXCEPTION: main
Process: co.poynt.services, PID: 31706
java.lang.NullPointerException
at co.poynt.services.AccessoryManagerService$GetAccessoryProvidersTask.onPostExecute(AccessoryManagerService.java:85)
at co.poynt.services.AccessoryManagerService$GetAccessoryProvidersTask.onPostExecute(AccessoryManagerService.java:58)
at android.os.AsyncTask.finish(AsyncTask.java:632)
at android.os.AsyncTask.access$600(AsyncTask.java:177)
at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:645)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5001)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
I am using following versions of api nad sdk
compile 'co.poynt.api:android-api-model:1.2.94@jar'
compile 'co.poynt.android.sdk:poynt-sdk:1.2.24@aar'
Poynt OS version:
poynt/k2/k2:4.4.4./KTU84Q/merchant-staging-19:user/release-keys
Please help what I am doing wrong?
Thank you