SocialApi SDK Wrappers - B4A Single-Sign-On with multiple providers

peacemaker

Expert
Licensed User
I tired in failed tries to combine this API with Google Maps :-(

I was moving variants of
B4X:
    #AdditionalRes: p:\Private\adt-bundle-windows-x86_64-20140321\sdk\extras\google\google_play_services\libproject\google-play-services_lib\res, com.google.android.gms
and
B4X:
#AdditionalRes: P:\Basic4android\Libraries\socialapi\googleplus\sdk\res, com.google.android.gms
and
B4X:
#AdditionalJar: P:\Basic4android\Libraries\socialapi\googleplus\sdk\gplussdk.jar
It cannot be combined by the compiler - or no resource for G services, or not added G+ classes :-(

B4X:
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/common/internal/safeparcel/SafeParcelable;
    at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:122)
    at com.android.dx.dex.file.DexFile.add(DexFile.java:161)
    at com.android.dx.command.dexer.Main.processClass(Main.java:685)
    at com.android.dx.command.dexer.Main.processFileBytes(Main.java:634)
    at com.android.dx.command.dexer.Main.access$600(Main.java:78)
    at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:572)
    at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284)
    at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
    at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
    at com.android.dx.command.dexer.Main.processOne(Main.java:596)
    at com.android.dx.command.dexer.Main.processAllFiles(Main.java:498)
    at com.android.dx.command.dexer.Main.runMonoDex(Main.java:264)
    at com.android.dx.command.dexer.Main.run(Main.java:230)
    at com.android.dx.command.dexer.Main.main(Main.java:199)
    at com.android.dx.command.Main.main(Main.java:103)
1 error; aborting
 

techknight

Well-Known Member
Licensed User
Looks like twitter is broken again or something. No login popup.

Tried both my Galaxy S6, and Tab 4.
 

Alberto Iglesias

Well-Known Member
Licensed User
Hello Periklis,

I need to get FriendsList from Facebook, like this:
B4X:
If Not(Common.Facebook.HasPermission(Common.Facebook.Constants.Permissions.READ_FRIENDLISTS)) Then
       Common.Facebook.RequestReadPermissions(Array As String (Common.Facebook.Constants.Permissions.READ_FRIENDLISTS))
End If

LogColor(Common.Facebook.GetFriends,Colors.Blue)
but always return:
(Result) {Canceled:false ,Message:(#100) No permission to access invitable_friends. ,Code:100 ,ErrorSubCode:0 ,Type:OAuthException ,Map:null}}


Do you know where i need to setup this?

Thank You

Alberto Iglesias
 

Alberto Iglesias

Well-Known Member
Licensed User
Yes, but I already connected, I can get name, email, etc but friends list no

** Activity (main) Create, isFirst = true **
RgVCCMBEvFUawNajyEZidOC5yEc=
** Activity (main) Resume **
(MyMap) {id=110440416115358, email=suporte@visualnet.inf.br, first_name=Visual, gender=male, last_name=Net, link=https://www.facebook.com/app_scoped_user_id/110440416115358/, locale=en_US, name=Visual Net, timezone=1, updated_time=2016-12-05T10:59:53+0000, verified=true}
** Activity (main) Pause, UserClosed = false **
 

Alberto Iglesias

Well-Known Member
Licensed User
I change the permissions in your library to : Common.Facebook.Constants.Permissions.USER_FRIENDS

but I get only GetTaggableFriends and not GetFriends
can you have ideia what is not comming?

B4X:
If Not(Common.Facebook.HasPermission(Common.Facebook.Constants.Permissions.USER_FRIENDS)) Then
   Common.Facebook.RequestReadPermissions(Array As String (Common.Facebook.Constants.Permissions.USER_FRIENDS))
End If

LogColor(Common.Facebook.GetFriends,Colors.Blue)
LogColor(Common.Facebook.GetTaggableFriends,Colors.Blue)
Result GetFriends: (Result) {Canceled:false ,Message:(#100) No permission to access invitable_friends. ,Code:100 ,ErrorSubCode:0 ,Type:OAuthException ,Map:null}}
Result GetTaggableFriends: (Result) {Canceled:false ,Message:{"data":[{"id":"AaLogLqZzc9Due984LBqr0sH9GXeNpoHbaU_JkMIVY-lm5kfB8Rc7N8LXSsPhagvlYqzBhaVh1s--rp6laDcD4AtpBqDe27H8OpjuH4EH8ErSg","name":"Vania Augusto Baroni","picture":{"data":{"is_silhouette":false,"url":"https:\/\/scontent.xx.fbcdn.net\/v\/t1.0-1\/p50x50\/13010826_1700741756846195_7155170837794735544_n.jpg?oh=cd69858711482db42eddbf0a1e2c09f6&oe=58FBA2DE"}}},{"id":"AaLzRhVRFgKM9ouxJsl0XkNHozuDIJ0dhvrqS7oz00UiCANUn8lxUrZkZSdWFjRxbeKajTtYY6OcEDbyv418zjC5edEGsSQ0lmdyzUrXc6P9Vg","name":"Marcos Borges","picture":{"data":{"is_silhouette":false,"url":"https:\/\/scontent.xx.fbcdn.net\/v\/t1.0-1\/p50x50\/14947778_1812678098948721_3077068083862113341_n.jpg?oh=e70e13dfe0d1eed64d476327c8c59e83&oe=58ED53B9"}}},{"id":"AaKDK4CkSDMvE8h2C8BUOfhwC8L-MRWFVVjnPljyIxgHZvVBNj6_R3rNIc1uoIY3fE9sMCFZj4Pat0G4AGinNNrBx7tacj_QDu8IAY-mP-tfpw","name":"Jason Humphries","picture":{"data":{"is_silhouette":false,"url":"https:\/\/scontent.xx.fbcdn.net\/v\/t1.0-1\/p50x50\/15284982_10154696891470053_4228693977292486626_n.jpg?oh=108b618b19611dcd4fa1f187ba0e2fff&oe=58EF0DBB"}}},{"id":"AaLJaTW9KkKuAsK6QUiC4JfFcdhjooX6eN6qOatIzCJw-giblNhVRWa1PCm5y72YgMwVWZ1P_1iBg6s1tB273pqejh-OlI8P1aTxFqsVeBBtAQ","name":"Paula Humphries","picture":{"data":{"is_silhouette":false,"url":"https:\/\/scontent.xx.fbcdn.net\/v\/t1.0-1\/p50x50\/12208332_10208037120343596_1286206479902921504_n.jpg?oh=cb4ab8c2635a73d2f73e08b7a12452d5&oe=58BC27BA"}}},{"id":"AaL_bOYgRf5TcT6bl6ZP6ysaeZxTVVNYkGhjnbOQOLHj37zwcSuUx1z2plrZ-Z-00C8X3otGmoqNKMhi3OnG9-juwYg_F5SWATAkYh3lOLmWHQ","name":"Eduardo Alonso Albella","picture":{"data":{"is_silhouette":false,"url":"https:\/\/scontent.xx.fbcdn.net\/v\/t1.0-1\/p50x50\/12122593_10156241305270106_5152996654780575201_n.jpg?oh=c641f4f8b70cee0b7c310a5d58858b21&oe=58BB652F"}}},{"id":"AaL0gV4vNEZUbXEt3zgtVJSgpCRCfe69h9jAq-WuBSTlg7-McZQMlK-WSwqd22Lny62ctFGjeofpbZ76_NsQOZ72_1QZ0-fn7Lr-yu1auGGT9g","name":"Lu Augusto","picture":{"data":{"is_silhouette":false,"url":"https:\/\/scontent.xx.fbcdn.net\/v\/t1.0-1\/p50x50\/13450150_1625935071066631_5881492810525760740_n.jpg?oh=74879662093bf0cf13704089109ed7cf&oe=58B9D8AC"}}},{"id":"AaINUvOvmMLjtnNvMtOm3m3Sik1Ys2xGyOySZWUtaqUqBzat3YCgZZpvo0nOB2Mjj-HcqT49pFx4Es5o2v9bK3VpsShekuC1zhUrkEJ3jirVKA","name":"Cristina Seixedo","picture":{"data":{"is_silhouette":false,"url":"https:\/\/scontent.xx.fbcdn.net\/v\/t1.0-1\/p50x50\/10250277_1115098478502460_807458593848167880_n.jpg?oh=39b8d06381ef41c280f0de5b8f248498&oe=58F64B7A"}}},{"id":"AaK4DzPYkvcJMh7kpx3z54ZtZH2KLceEBpC17F5BS1IbVD1NZhBJcW4vsYBc6dJ2swqdJ3UCMf0sBoxlp17Y7uM2yXOmy1I4JHGTTfcAG65hhg","name":"Aline Gaino","picture":{"data":{"is_silhouette":false,"url":"https:\/\/scontent.xx.fbcdn.net\/v\/t1.0-1\/p50x50\/14681599_654845851349028_5121804155074539436_n.jpg?oh=4d8adea833131a035b74df4330fd48b7&oe=58C2F23D"}}},{"id":"AaKMecw84psgcquCpBYmGslbkCZnJD0QPeOwWMUptqm7CZr-q_liSklrUo0r7Zx4yAbbD4M1EcYIfeAn0ZhBhG38pVjQmJXKNLK8nSmq_xOcpw","name":"Ede Galileu","picture":{"data":{"is_silhouette":false,"url":"https:\/\/scontent.xx.fbcdn.net\/v\/t1.0-1\/c1.0.50.50\/p50x50\/10351815_10205077388360692_8546971589787091956_n.jpg?oh=3a5b7a7d0f9d5804d5d515c2359ff665&oe=58B882B3"}}},{"id":"AaIGBN4K9XvDXMJ163xXZeJDWYWI5ahyHkQYcvom9oIVpBfJxABE4u4SYap_fmXdPwiG2lpq7_sm07ZMhYzr5pdNwomdlE48WA2CNC6BZjASjQ","name":"Sidnei Rech","picture":{"data":{"is_silhouette":false,"url":"https:\/\/scontent.xx.fbcdn.net\/v\/t1.0-1\/c0.11.50.50\/p50x50\/13600297_103785330057508_1204748063650081858_n.jpg?oh=c4a7539622e7ee19e4b815f23cc76fa4&oe=58BEBB89"}}},{"id":"AaKX7ZYg-W5BY8UqlfwRaCmx4Go_fArKeDlGlBj888US693gsTH1gwliXBE3rjKex9fSFS1B0ttg_vklAqhEV8H9fhlbPZ8FYPn_rTsnMe9utg","name":"Kenny Teixeira","picture":{"data":{"is_silhouette":false,"url":"https:\/\/scontent.xx.fbcdn.net\/v\/t1.0-1\/p50x50\/11707376_852361238181790_3370875620119759437_n.jpg?oh=1a504f1110bc4f31119665f222103d82&oe=58F5FF29"}}},{"id":"AaJQpPHdPzoNDt8KZja89Y5TjOwFMhhRK2UTa0sYrN3srrnyXI6ZLaEhL1DUrekWv0jjYckQkLo7PFMET2Gk2OE5Xv9eqMB0p94ERK1ov-UvxA","name":"Jenaro F. S\u00e1ez","picture":{"data":{"is_silhouette
 

dataware

Member
Licensed User
Am trying to implement the libraries socialapi.xml and socialapi.jar, i put it on libraries folder on B4A, but, when am compiling this send me an error, someone can explain me why?

This is the error code, TNKS.


** Activity (main) Pause, UserClosed = false **
:null,0
android.content.res.Resources$NotFoundException: String resource ID #0x0
at android.content.res.Resources.getText(Resources.java:327)
at android.content.res.Resources.getString(Resources.java:415)
at com.datasteam.b4a.socialapi.FacebookProvider.<init>(FacebookProvider.java:99)
at java.lang.Class.newInstance(Native Method)
at anywheresoftware.b4a.shell.Shell.createObject(Shell.java:589)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:355)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:247)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
at b4a.example.main.afterFirstLayout(main.java:95)
at b4a.example.main.access$000(main.java:17)
at b4a.example.main$WaitForLayout.run(main.java:80)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5527)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:730)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)
java.lang.OutOfMemoryError: Failed to allocate a 134217740 byte allocation with 8388608 free bytes and 120MB until OOM
at anywheresoftware.b4a.shell.ShellConnector.readObject(ShellConnector.java:280)
at anywheresoftware.b4a.shell.Shell.setArrayElement(Shell.java:570)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:375)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:247)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
at b4a.example.main.afterFirstLayout(main.java:95)
at b4a.example.main.access$000(main.java:17)
at b4a.example.main$WaitForLayout.run(main.java:80)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5527)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:730)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)
java.lang.OutOfMemoryError: Failed to allocate a 184555118 byte allocation with 8388608 free bytes and 120MB until OOM
at anywheresoftware.b4a.shell.ShellConnector.readObject(ShellConnector.java:280)
at anywheresoftware.b4a.shell.ShellConnector.readList(ShellConnector.java:221)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:694)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:337)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:247)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
at b4a.example.main.initializeGlobals(main.java:312)
at b4a.example.main.afterFirstLayout(main.java:99)
at b4a.example.main.access$000(main.java:17)
at b4a.example.main$WaitForLayout.run(main.java:80)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5527)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:730)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)
** Activity (main) Create, isFirst = true **
java.lang.OutOfMemoryError: Failed to allocate a 134217740 byte allocation with 8388608 free bytes and 120MB until OOM
at anywheresoftware.b4a.shell.ShellConnector.readObject(ShellConnector.java:280)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:686)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:340)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:247)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
at b4a.example.main.afterFirstLayout(main.java:102)
at b4a.example.main.access$000(main.java:17)
at b4a.example.main$WaitForLayout.run(main.java:80)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5527)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:730)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)
** Activity (main) Resume **
:null,0
java.lang.RuntimeException: Unknown type in readObject: 24
at anywheresoftware.b4a.shell.ShellConnector.readObject(ShellConnector.java:290)
at anywheresoftware.b4a.shell.Shell.createArray(Shell.java:557)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:369)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:247)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:153)
at b4a.example.main.afterFirstLayout(main.java:108)
at b4a.example.main.access$000(main.java:17)
at b4a.example.main$WaitForLayout.run(main.java:80)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5527)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:730)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)
java.lang.OutOfMemoryError: Failed to allocate a 134217740 byte allocation with 8388608 free bytes and 120MB until OOM
at anywheresoftware.b4a.shell.ShellConnector.readObject(ShellConnector.java:280)
at anywheresoftware.b4a.shell.Shell.debugPause(Shell.java:523)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:406)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:247)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:153)
at b4a.example.main.afterFirstLayout(main.java:108)
at b4a.example.main.access$000(main.java:17)
at b4a.example.main$WaitForLayout.run(main.java:80)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5527)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:730)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
 
Top