SDK RAD Studio - Delphi - device not supported

0 votes
Hi, I downloaded sdk to rad studio(Delphi) XE7, win 8.1.

I installed without problems and did the delphi settings.

I did some tests with kinvey provider. I buided my app and I installed into my device and all works well.

I did a similar project and I change the provider to app42. I buided my app andI installed into my device, but when the app starts I get a message of device not supported. I use galaxy S2 to test and all works well with kinvey and parser provider.

Am I doing something wrong with app42 provider?

 

Luiz
asked May 4, 2015 in App42 Cloud API-BaaS by cprmlao (10 points)

1 Answer

0 votes

Hi Luiz,

Can you please let us know the complete console logs? Also please make sure you have followed the tutorial mentioned here .

 

Thanks & Regards

Himanshu Sharma

answered May 5, 2015 by hs00105 (2,005 points)
Hi, thank you for help me.

I solved it using a tip posted at http://stackoverflow.com/questions/26754606/embarcadero-c-builder-xe7-application-does-not-support-this-device.
My test device is Samsung S2, Android 4.03.
It´s a workaround and I think there is something wrong with sdk to Delphi XE7 because Kinvey and Parse Provider don´t exhibit this problem.

With this tip, the app42 app is installed, but I am getting a Access Violation  after onRegister event.

I did a simple project with only a form using the sample posted at http://api.shephertz.com/tutorial/AppMethod-PushNotification-Android/?index=appmethod-androidPush

//this event never is called because there is a AV before
procedure TForm1.PushEvents1DeviceRegistered(Sender: TObject);
begin
  Memo1.Lines.Add('Device Registered');
  Memo1.Lines.Add('');
end;

//here all works well
//and Memo1 lines shows
procedure TForm1.PushEvents1DeviceTokenReceived(Sender: TObject);
begin
   Memo1.Lines.Add('Device Token Received');-->works well
   Memo1.Lines.Add(PushEvents1.DeviceToken);-->works well
   Memo1.Lines.Add('');-->works well
end;

//AV happens here
procedure TForm1.PushEvents1DeviceTokenRequestFailed(Sender: TObject;
  const AErrorMessage: string);
begin
  Memo1.Lines.Add('Device Token Request Failed');-->works well
  Memo1.Lines.Add(AErrorMessage);--> ACCCES  VIOLATION
  Memo1.Lines.Add('');
end;


Here is the call stack:
System._DbgExcNotify(1394976376,0xa9bc20,0x51e7f15f,0xa9bc20,0x51e7f15f)
System.NotifyReRaise(0xa9bc20,0x51e7f15f)
System._RaiseAtExcept(0xa9bc20,0x51e7f15f)
System._RaiseExcept(0xa9bc20)
Idhttp.TIdHTTPProtocol.ProcessResponse(short*, int).CheckException(void*)(@0x5325a644: {})
Idhttp.TIdHTTPProtocol.ProcessResponse(0xa59618)
Idhttp.TIdCustomHTTP.DoRequest(0xa59228,'GET','https://api.shephertz.com/cloud/1.0/user/testuser',nil,0xa8a0a0,{-22920},-1)
Idhttp.TIdCustomHTTP.Get(0xa59228,'https://api.shephertz.com/cloud/1.0/user/testuser',0xa8a0a0,{-22328},-1)
Idhttp.TIdCustomHTTP.Get(0xa59228,'https://api.shephertz.com/cloud/1.0/user/testuser',0xa8a0a0)
Ippeerclient.TIdHTTPPeer.DoGet(0xa591c8,'https://api.shephertz.com/cloud/1.0/user/testuser',0xa8a0a0)
:51EA4098 __stub_in48s__ZN12Ippeerclient11TIdHTTPPeer5DoGetEN6System13UnicodeStringEPNS1_7Classes7TStreamE
Rest.Httpclient.TRESTHTTP.Get(0xa57ac8,'https://api.shephertz.com/cloud/1.0/user/testuser',0xa8a0a0)
Rest.Client.TCustomRESTRequest.Execute(0xa60c80)
Rest.Backend.App42api.TApp42Api.UserFromUserName(0xa56cd8,'testuser')
Rest.Backend.App42api.TApp42Api.PushRegisterDevice(0xa56cd8,Android,'APA91bGkVR6Crm2Jq_yXQrW4eNlh47i-ZJ1Vm-qAfreSqzQPP8Dw4ZyakEflq7zStg8pL2BKh-RoiPrhEZtQClOBJb4Rrhzdu1MCVruOfGFZ_CNA4tqn2GstIwkfWB4_jUoOBwD9KUHZ2LOsSn6avCmPhvvGKFwyHw')
Rest.Backend.App42pushdevice.TApp42PushDeviceAPI.RegisterDevice(void (* __closure)(System.Pushnotification.TPushService*))(0xa47e80,{Code = 0x523cfb59 <Rest.Backend.Pushdevice.TCustomPushEvents.OnPushDeviceRegisterDevice(System.Pushnotification.TPushService*)>, Data = 0xa3ff68})
:523CBD5C __stub_in32s__ZN4Rest7Backend15App42pushdevice19TApp42PushDeviceAPI14RegisterDeviceEU9__closurePFvPN6System16Pushnotification12TPushServiceEE
Rest.Backend.Pushdevice.TCustomPushEvents.RegisterDevice(0xa3ff68)
Rest.Backend.Pushdevice.TCustomPushEvents.PushServiceOnChange(0xa3ff68,0xa66c38,3)
System.Pushnotification.TPushServiceConnection.DoChange(0xa66c38,3)
System.Pushnotification.TPushService_DoChange$19$ActRec.$0$Body(0xa69bc8,0xa66c38)
:51EC07FC __stub_in16s__ZN6System16Pushnotification31TPushService_DoChange$19$ActRec7$0$BodyEPNS0_22TPushServiceConnectionE
System.Pushnotification.TPushService.ForConnections(0x7a9860,0xa69bd8)
System.Pushnotification.TPushService.DoChange(0x7a9860,3)
Fmx.Pushnotification.Android.TGCMPushService.Register(0x7a9860,'890524737569')
Fmx.Pushnotification.Android.TGCMPushService.StartService(0x7a9860)
System.Pushnotification.TPushServiceConnection.SetActive(0xa66c38,true)
Rest.Backend.Pushdevice.TCustomPushEvents.ActivatePushServiceConnection(0xa3ff68)
Rest.Backend.Pushdevice.TCustomPushEvents.SetActive(0xa3ff68,true)
Rest.Backend.Pushdevice.TCustomPushEvents.Loaded(0xa3ff68)
System.Classes.NotifyGlobalLoading
System.Classes.InitInheritedComponent(0x52c4132c)
Fmx.Forms.TCommonCustomForm.TCommonCustomForm(0x7ac9a8,0,0x30f9f0)
Fmx.Forms.TCustomForm.TCustomForm(0x7ac9a8,255,0x30f9f0)
Fmx.Forms.TApplication.CreateForm(0x30f9f0,0x52fb52cc,0x5314be0c)
Fmx.Forms.TApplication.RealCreateForms(0x30f9f0)
Fmx.Platform.Android.TPlatformAndroid.HandleAndroidCmd(0x30f8a8,1)
Fmx.Platform.Android.HandleAndroidCmd(@0xc1640: {userData = nil, onAppCmd = 0x51ca8f69 <Fmx.Platform.Android.HandleAndroidCmd(Androidapi.Appglue.TAndroid_app&, int)>, onInputEvent = 0x51ca8f31 <Fmx.Platform.Android.HandleAndroidInputEvent(Androidapi.Appglue.TAndroid_app&, AInputEvent*)>, activity = 0x2c7e30, config = 0xc1270, savedState = nil, savedStateSize = 0, looper = 0x2a8dc8, inputQueue = 0x7aaae8, window = 0x7abdf0, contentRect = {left = 0, top = 0, right = 0, bottom = 0}, activityState = 11, destroyRequested = 0, mutex = {value = 0}, cond = {value = -50}, msgread = 46, msgwrite = 47, thread = 0, cmdPollSource = {id = 1, app = 0xc1640, process = 0x51abc1f9 <Androidapi.Appglue.process_cmd(Androidapi.Appglue.TAndroid_app*, Androidapi.Appglue.android_poll_source*)>}, inputPollSource = {id = 2, app = 0xc1640, process = 0x51abc105 <Androidapi.Appglue.process_input(Androidapi.Appglue.TAndroid_app*, Androidapi.Appglue.android_poll_source*)>}, running = 1, stateSaved = 1, destroyed = 0, redrawNeeded = 0, pendingInputQueue = 0x7aaae8, pendingWindow = 0x7abdf0, pendingContentRect = {left = 0, top = 0, right = 0, bottom = 0}},1)
Androidapi.Appglue.process_cmd(0xc1640,0xc1694)
Fmx.Platform.Android.TPlatformAndroid.InternalProcessMessages(0x30f8a8)
Fmx.Platform.Android.TPlatformAndroid.Run(0x30f8a8)
:51C930C2 __stub_in268s__ZN3Fmx8Platform7Android16TPlatformAndroid3RunEv
Fmx.Forms.TApplication.Run(0x30f9f0)

--------------------

I debug  the error It seems the problem is here. It throw AV because there is a HTTP1.1 404 not found Error.
I have a user created in Business Service Manager called 'testuser'.
I have app42provider settings correctly with AndroidPush.GCMAPPId='with my google project number'  and apiKey and secret key filled. And I have Username='testuser'


procedure TApp42Api.PushRegisterDevice(APlatformType: TPlatformType; const ADeviceID: string);
var
LUser: TUser;
LUserObject : TJSONObject;
begin
  LUserObject := UserFromUserName(FConnectionInfo.UserName);-->Throw AV because there is a HTTP1.1 404 not found Error
  LUser := UserFromObject(LUserObject);
  PushRegisterDevice(APlatformType, ADeviceID, LUser.FObjectID);
end;
Hello Cprmlao,

Could you please check your push user under Push Notification >> Users section of AppHQ management console? Are you able to see your registered users here.

Please check and let us know it will help us to debug the root cause of this issue.

Thanks,
Himanshu Sharma
I have my user 'testuser' created manually by app42 console in Business Service Manager>>User Service>>User.
I have no user in Push Notification >> Users section. It's empty.. If I understood the logic, when the sample app works correctly with sdk, the user 'testuser' should be appearing in Push Notification >> Users section after the register. But It´s ocurring an AV before register the device in App42 in the next procedure of the SDK: See call stack for detail.

procedure TApp42Api.PushRegisterDevice(APlatformType: TPlatformType; const ADeviceID: string);
var
LUser: TUser;
LUserObject : TJSONObject;
begin
  LUserObject := UserFromUserName(FConnectionInfo.UserName);-->Throw AV because there is a HTTP1.1 404 not found Error
  LUser := UserFromObject(LUserObject);
  PushRegisterDevice(APlatformType, ADeviceID, LUser.FObjectID);
end;


Regards, Luiz
Could you please share your appname which you have created in AppHQ Management Console with us at support@shephertz.com. It will help us to provide better support to you.

Thanks,
Himanshu Sharma
Hi,
I just send you the appname to your email.
Only as information, I have seen this is an old problem that happens with other user. See  link http://forum.shephertz.com/?qa=5825/error-testing-push-notification-using-appmethod-xe7

Best Regards,
Luiz
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...