• bhariharan
  • NEWBIE
  • 208 Points
  • Member since 2013
  • Salesforce.com

  • Chatter
    Feed
  • 8
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 64
    Replies

I've been looking at the SQLAggrigator for hours now.  I can query just fine, but insert doesnt work.  Is there any possible way to insert a record into the leads/contacts from the native mobile sdk?

In the Salesforce iOS Mobile app (from SDK), I know you can change the login url (Production, Sandbox, or Custom) via  Settings|MyApp.

 

How can you do this for the Android (I am new to Android side of things) via UI instead of hard coding the URL in the Java or adding it to the servers.xml file.

 

I see a couple of references to this area in res/menu/sf_clear_custom_url.xml and res/menu/sf_login.xml, but do not see it exposed anywhere in the UI (e.g. in Settings etc.).

 

Is there some other configuration I need to do to enable this - for Android 4.03+, using Saleforce Mobile SDK 2.x, Hybrid.

 

Thanks.

 

  • October 22, 2013
  • Like
  • 0

There are lots sample code and getting started, but no documentation (that I could find) about the methods available in the SDK itself. We happen to be building an android hybrid app, but where is the API guide for the mobile SDK for hybrid use?

  • September 27, 2013
  • Like
  • 0

Hi,

 

I am trying to install iOS SDK on windows 7 plateform. I have installed node on my system (as per instruction on http://www2.developerforce.com/en/mobile/getting-started/ios). No I am trying to run below command on command promt.

 

>npm install forceios

 

I am getting below result.

 

npm http GET https://registry.npmjs.org/forceios
npm http 304 https://registry.npmjs.org/forceios
npm ERR! notsup Unsupported
npm ERR! notsup Not compatible with your operating system or architecture: force
ios@2.0.3
npm ERR! notsup Valid OS:    darwin
npm ERR! notsup Valid Arch:  any
npm ERR! notsup Actual OS:   win32
npm ERR! notsup Actual Arch: ia32

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program File
s (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "forceios"
npm ERR! cwd E:\Salesforce\iOS Integratation\SalesforceMobileSDK-iOS-master
npm ERR! node -v v0.10.18
npm ERR! npm -v 1.3.8
npm ERR! code EBADPLATFORM
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     E:\Salesforce\iOS Integratation\SalesforceMobileSDK-iOS-master\npm-
debug.log

 Not able to find any solution for this error. Also tried to remove os dependency (as per https://github.com/dmcquay/node-apac/pull/32 ) but i didn't find os list in package.json file.

 

Anybody have idea how to install forceios on windows 7 plateform?

 

I have a build a custom hybrid mobile app. I need to have a button in that app, when touched should open the camera to take pics. Once picture is taken it should save in the local storage and should be used by the users to upload to salesforce later.

  • September 19, 2013
  • Like
  • 0

I have developed HTML5 app which is working just fine in browser.

 

Now I'm looking for Hybrid Remote app (android & iOS). I created connected app to SF, URL is pointing to my HTML5 app. Hybrid remote client starts fine, shows login and then goes fine to my app. Working perfectly to this stage.

 

But then, my app have logout button which redirects to /secur/logout.jsp, with browser this works as expected. With hybrid app, it logouts and shows the login screen again but if I now try login again, it opens to SF home page and not my HTML5 what I expected. Also, if I restart hybrid app, it goes straight to HTML5 app so looks like the hybrid app did not logout.

 

How I should implement the logout so it will logout the hybrid client. Can I somehow listen URL where hybrid app webview is going ?

 

  • September 18, 2013
  • Like
  • 0


I'm in a tricky situation where my org has more than 2,000 records for objects which I'm trying to fetch in my Android native app

 

RestRequest restRequest = RestRequest.getRequestForQuery( getString(R.string.api_version), soql);

 

and then I get the response using

 

RegistrationActivity.client.sendAsync(restRequest, new AsyncRequestCallback() { @Override public void onSuccess(RestRequest request, RestResponse result) { }

 

This approach suffers the limitation that it can only return 2,000 records in the SOQL. In the response, I'm getting the nextRecordsUrl in the response and I can retrieve it as

 

 

nextRecordsUrl =result.asJSONObject().getString("nextRecordsUrl").toString();

 

Now, my understanding is that I will need to fire HTTP GET requests to this URL using this approach

 

 

Http h = new Http(); HttpRequest req = new HttpRequest(); req.setEndpoint("http://na1.salesforce.com" + nextRecordsUrl); req.setMethod('GET'); req.setHeader('Authorization', 'OAuth ' + UserInfo.getSessionId()); req.setHeader('Content-Type', 'application/json'); HttpResponse res = h.send(req);

 

and then parse the response.

 

While this approach is theoretically possible, I'm not very keen on mixing 2 approaches - getting the initial records using RestClient getRequestForQuery() method and follow up data (more than 2,000 records) using the HttpRequest method.

 

 

Can anyone guide me on the correct/ coherent way of fetching object data (more than 2,000 records) in a native force.com Android app?

Hello everybody,

 

I was trying to get a Hybrid app up and running, using AngularJS and SmartStore, but I just can't seem to get it to work, I tried importing the www folder from the angularJS cordova bootstrap example in AngularJS repo, replacing Cordova and force javascript files in that folder with the Android ones, and the pasting that folder on the newly created hybrid app (the one created with forceDroid).
The application starts with no problem if I manage it only online, but when I import the SmartStore library, it stops working, this is a very strong requirement for my project, so I need to make it work.
I appreciate any help from someone who could make AngularJS and SmartStore work toghether, thanks in advance.

Agustín Gallardo.

 

Here's a console LOG, if it helps in any way.

08-26 12:57:30.181: D/HttpAccess:constructor(329): User-Agent string: SalesforceMobileSDK/2.0.3 android mobile/2.3.3 (sdk) hybridTestingAngularJS/1.0 Hybrid
08-26 12:57:30.290: I/SalesforceDroidGapActivity.onCreate(329): onCreate called
08-26 12:57:30.494: I/SalesforceDroidGapActivity.onResumeLoggedInNotLoaded(329): Local start page - loading web app
08-26 12:57:30.500: I/SalesforceDroidGapActivity.loadLocalStartPage(329): loading: index.html
08-26 12:57:30.530: I/dalvikvm(329): Could not find method android.webkit.WebView.<init>, referenced from method org.apache.cordova.CordovaWebView.<init>
08-26 12:57:30.530: W/dalvikvm(329): VFY: unable to resolve direct method 584: Landroid/webkit/WebView;.<init> (Landroid/content/Context;Landroid/util/AttributeSet;IZ)V
08-26 12:57:30.530: D/dalvikvm(329): VFY: replacing opcode 0x70 at 0x0001
08-26 12:57:30.530: D/dalvikvm(329): VFY: dead code 0x0004-005b in Lorg/apache/cordova/CordovaWebView;.<init> (Landroid/content/Context;Landroid/util/AttributeSet;IZ)V
08-26 12:57:30.690: I/CordovaLog(329): Changing log level to DEBUG(3)
08-26 12:57:30.690: I/CordovaLog(329): Found preference for classicRender=true
08-26 12:57:30.700: D/CordovaLog(329): Found preference for classicRender=true
08-26 12:57:30.730: D/JsMessageQueue(329): Set native->JS mode to 2
08-26 12:57:30.730: I/CordovaWebView(329): Disabled addJavascriptInterface() bridge callback due to a bug on the 2.3 emulator
08-26 12:57:30.730: I/SalesforceDroidGapActivity.init(329): init called
08-26 12:57:30.739: D/DroidGap(329): DroidGap.init()
08-26 12:57:30.769: D/CordovaWebView(329): >>> loadUrl(file:///android_asset/www/index.html)
08-26 12:57:30.769: D/PluginManager(329): init()
08-26 12:57:30.789: D/CordovaWebView(329): >>> loadUrlNow()
08-26 12:57:30.799: D/SoftKeyboardDetect(329): Ignore this event
08-26 12:57:30.879: D/SoftKeyboardDetect(329): Ignore this event
08-26 12:57:31.340: D/DroidGap(329): onMessage(onPageStarted,file:///android_asset/www/index.html)
08-26 12:57:31.500: D/szipinf(329): Initializing inflate state
08-26 12:57:31.500: D/szipinf(329): Initializing zlib to inflate
08-26 12:57:31.520: D/szipinf(329): Initializing inflate state
08-26 12:57:31.520: D/szipinf(329): Initializing zlib to inflate
08-26 12:57:31.570: D/szipinf(329): Initializing inflate state
08-26 12:57:31.570: D/szipinf(329): Initializing zlib to inflate
08-26 12:57:31.580: D/szipinf(329): Initializing inflate state
08-26 12:57:31.600: D/szipinf(329): Initializing zlib to inflate
08-26 12:57:34.670: I/SalesforceGapViewClient(329): Setting 'file:///android_asset/www/index.html' as the home page URL for this app
08-26 12:57:34.670: D/Cordova(329): onPageFinished(file:///android_asset/www/index.html)
08-26 12:57:34.670: D/DroidGap(329): onMessage(onNativeReady,null)
08-26 12:57:34.670: D/DroidGap(329): onMessage(onPageFinished,file:///android_asset/www/index.html)
08-26 12:57:34.889: I/Database(329): sqlite returned: error code = 14, msg = cannot open file at source line 25467
08-26 12:57:35.100: D/CordovaLog(329): Falling back on PROMPT mode since _cordovaNative is missing.
08-26 12:57:35.100: I/Web Console(329): Falling back on PROMPT mode since _cordovaNative is missing. at file:///android_asset/www/js/cordova/cordova-2.3.0.js:1110
08-26 12:57:35.130: D/CordovaNetworkManager(329): Connection Type: 3g
08-26 12:57:35.130: D/CordovaNetworkManager(329): Connection Type: 3g
08-26 12:57:35.130: D/DroidGap(329): onMessage(networkconnection,3g)
08-26 12:57:35.220: D/DroidGap(329): onMessage(spinner,stop)
08-26 12:57:35.330: D/dalvikvm(329): GC_CONCURRENT freed 911K, 53% free 3164K/6727K, external 2002K/2137K, paused 5ms+6ms
08-26 12:57:35.460: I/SalesforceOAuthPlugin.execute(329): action: getAuthCredentials, jsVersion: 2.0.0
08-26 12:57:35.460: W/SalesforceOAuthPlugin.execute(329): is being called by js from older sdk, jsVersion: 2.0.0, nativeVersion: 2.0.3
08-26 12:57:35.460: I/SalesforceOAuthPlugin.getAuthCredentials(329): getAuthCredentials called
08-26 12:57:35.470: I/SalesforceOAuthPlugin.getAuthCredentials(329): getAuthCredentials successful
08-26 12:57:35.540: D/CordovaLog(329): -----> Calling smartstoreClient:registerSoup
08-26 12:57:35.540: I/Web Console(329): -----> Calling smartstoreClient:registerSoup at file:///android_asset/www/js/entity/force.entity.js:46
08-26 12:57:35.550: D/CordovaLog(329): SmartStore.registerSoup: 'sobjects' indexSpecs: [{"path":"Id","type":"string"},{"path":"__local__","type":"string"},{"path":"Name","type":"string"},{"path":"attributes.type","type":"string"}]
08-26 12:57:35.550: I/Web Console(329): SmartStore.registerSoup: 'sobjects' indexSpecs: [{"path":"Id","type":"string"},{"path":"__local__","type":"string"},{"path":"Name","type":"string"},{"path":"attributes.type","type":"string"}] at file:///android_asset/www/js/cordova/cordova.force.js:479
08-26 12:57:35.560: I/SmartStorePlugin.execute(329): action: pgRegisterSoup, jsVersion: 2.0.0
08-26 12:57:35.560: W/SmartStorePlugin.execute(329): is being called by js from older sdk, jsVersion: 2.0.0, nativeVersion: 2.0.3
08-26 12:57:35.560: D/AndroidRuntime(329): Shutting down VM
08-26 12:57:35.569: W/dalvikvm(329): threadid=1: thread exiting with uncaught exception (group=0x40015560)
08-26 12:57:35.580: E/AndroidRuntime(329): FATAL EXCEPTION: main
08-26 12:57:35.580: E/AndroidRuntime(329): java.lang.ClassCastException: com.salesforce.androidsdk.app.SalesforceSDKManager
08-26 12:57:35.580: E/AndroidRuntime(329):     at com.salesforce.androidsdk.smartstore.app.SalesforceSDKManagerWithSmartStore.getInstance(SalesforceSDKManagerWithSmartStore.java:156)
08-26 12:57:35.580: E/AndroidRuntime(329):     at com.salesforce.androidsdk.smartstore.phonegap.SmartStorePlugin.getSmartStore(SmartStorePlugin.java:401)
08-26 12:57:35.580: E/AndroidRuntime(329):     at com.salesforce.androidsdk.smartstore.phonegap.SmartStorePlugin.registerSoup(SmartStorePlugin.java:300)
08-26 12:57:35.580: E/AndroidRuntime(329):     at com.salesforce.androidsdk.smartstore.phonegap.SmartStorePlugin.execute(SmartStorePlugin.java:110)
08-26 12:57:35.580: E/AndroidRuntime(329):     at com.salesforce.androidsdk.phonegap.ForcePlugin.execute(ForcePlugin.java:78)
08-26 12:57:35.580: E/AndroidRuntime(329):     at org.apache.cordova.api.CordovaPlugin.execute(CordovaPlugin.java:61)
08-26 12:57:35.580: E/AndroidRuntime(329):     at org.apache.cordova.api.PluginManager.exec(PluginManager.java:224)
08-26 12:57:35.580: E/AndroidRuntime(329):     at org.apache.cordova.ExposedJsApi.exec(ExposedJsApi.java:45)
08-26 12:57:35.580: E/AndroidRuntime(329):     at org.apache.cordova.CordovaChromeClient.onJsPrompt(CordovaChromeClient.java:213)
08-26 12:57:35.580: E/AndroidRuntime(329):     at android.webkit.CallbackProxy.handleMessage(CallbackProxy.java:566)
08-26 12:57:35.580: E/AndroidRuntime(329):     at android.os.Handler.dispatchMessage(Handler.java:99)
08-26 12:57:35.580: E/AndroidRuntime(329):     at android.os.Looper.loop(Looper.java:123)
08-26 12:57:35.580: E/AndroidRuntime(329):     at android.app.ActivityThread.main(ActivityThread.java:3683)
08-26 12:57:35.580: E/AndroidRuntime(329):     at java.lang.reflect.Method.invokeNative(Native Method)
08-26 12:57:35.580: E/AndroidRuntime(329):     at java.lang.reflect.Method.invoke(Method.java:507)
08-26 12:57:35.580: E/AndroidRuntime(329):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
08-26 12:57:35.580: E/AndroidRuntime(329):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
08-26 12:57:35.580: E/AndroidRuntime(329):     at dalvik.system.NativeStart.main(Native Method)


  • August 26, 2013
  • Like
  • 0

Hi All,
we are trying to build a Hybrid_remote mobile app using visual force pages.
I have seen lot of contents over internet which says how to create hybrid app from cmd prompt using forcedroid.

My question is how do i import these forcedroid projects in eclipse? When I import this hybrid_remote project into eclipse, I'm getting errors in the project directories.. Below the steps how I imported the hybrid app project and the results.

User-added image

2) The imported project with errors
User-added image

I'm not sure what is the error.. I could import forcedroid created native apps successfully.. 
Can someone provide me some materials or guide to create hybrid apps using salesforce mobile sdk...
 

Hi,

based on the Android's SmartSyncExplorer App I am trying to delete a single contact on the android device which has been deleted through the web based application.
Everytime I syncDown newly added contacts are stored on the device BUT deleted contacts are kept in the smartStore.
Is there a way to accomblish this by setting a parameter or do I really have to change the SDK methods, such as SyncManager.syncDownSoql(...) ?

Thanks
I am new to developing android app using salesforce SDK. I have succesfully created a sample app using forcedroid tool.
But i am unable to run this using android studio. 
Hello,

I see that on iOS, I can switch between sandbox and production on iOS by going to Settings -> App -> Change Server 

However, I am not able to find how to do it on Android. Is it possible? How? Please help.

I'm trying to follow the guide for creating a hybrid app and running it.

I am able to successfully create the hybrid_local project using forcedroid create. However, when I attempt to run it as an Android Application in eclipse, it crashes when trying to read the bootconfig.json, due to file not found.

The bootconfig.json is located in the root\www and also root\platforms\android\www directories. I removed the Resource Filter, so it does show up in my Project Explorer.

Environment details:
Android SDK Tools 23.0.5
Android SDK Platform Tools 21
Mobile SDK Android 2.3.0

Steps I follow:
cd [target.dir]
forcedroid create
[enter settings and create]
open Eclipse
import existing android projects
browse [target.dir]
select all 4 projects
right click project
run as android application

Log details below:

10-22 18:59:12.489: E/AndroidRuntime(866): FATAL EXCEPTION: main
10-22 18:59:12.489: E/AndroidRuntime(866): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test/com.salesforce.androidsdk.ui.sfhybrid.SalesforceDroidGapActivity}: com.salesforce.androidsdk.rest.BootConfig$BootConfigException: Failed to open www/bootconfig.json
10-22 18:59:12.489: E/AndroidRuntime(866):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
10-22 18:59:12.489: E/AndroidRuntime(866):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
10-22 18:59:12.489: E/AndroidRuntime(866):     at android.app.ActivityThread.access$600(ActivityThread.java:141)
10-22 18:59:12.489: E/AndroidRuntime(866):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
10-22 18:59:12.489: E/AndroidRuntime(866):     at android.os.Handler.dispatchMessage(Handler.java:99)
10-22 18:59:12.489: E/AndroidRuntime(866):     at android.os.Looper.loop(Looper.java:137)
10-22 18:59:12.489: E/AndroidRuntime(866):     at android.app.ActivityThread.main(ActivityThread.java:5041)
10-22 18:59:12.489: E/AndroidRuntime(866):     at java.lang.reflect.Method.invokeNative(Native Method)
10-22 18:59:12.489: E/AndroidRuntime(866):     at java.lang.reflect.Method.invoke(Method.java:511)
10-22 18:59:12.489: E/AndroidRuntime(866):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
10-22 18:59:12.489: E/AndroidRuntime(866):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
10-22 18:59:12.489: E/AndroidRuntime(866):     at dalvik.system.NativeStart.main(Native Method)
10-22 18:59:12.489: E/AndroidRuntime(866): Caused by: com.salesforce.androidsdk.rest.BootConfig$BootConfigException: Failed to open www/bootconfig.json
10-22 18:59:12.489: E/AndroidRuntime(866):     at com.salesforce.androidsdk.rest.BootConfig.readBootConfigFile(BootConfig.java:156)
10-22 18:59:12.489: E/AndroidRuntime(866):     at com.salesforce.androidsdk.rest.BootConfig.readFromJSON(BootConfig.java:125)
10-22 18:59:12.489: E/AndroidRuntime(866):     at com.salesforce.androidsdk.rest.BootConfig.getBootConfig(BootConfig.java:88)
10-22 18:59:12.489: E/AndroidRuntime(866):     at com.salesforce.androidsdk.ui.sfhybrid.SalesforceDroidGapActivity.onCreate(SalesforceDroidGapActivity.java:116)
10-22 18:59:12.489: E/AndroidRuntime(866):     at android.app.Activity.performCreate(Activity.java:5104)
10-22 18:59:12.489: E/AndroidRuntime(866):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
10-22 18:59:12.489: E/AndroidRuntime(866):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
10-22 18:59:12.489: E/AndroidRuntime(866):     ... 11 more
10-22 18:59:12.489: E/AndroidRuntime(866): Caused by: java.io.FileNotFoundException: www/bootconfig.json
10-22 18:59:12.489: E/AndroidRuntime(866):     at android.content.res.AssetManager.openAsset(Native Method)
10-22 18:59:12.489: E/AndroidRuntime(866):     at android.content.res.AssetManager.open(AssetManager.java:315)
10-22 18:59:12.489: E/AndroidRuntime(866):     at android.content.res.AssetManager.open(AssetManager.java:289)
10-22 18:59:12.489: E/AndroidRuntime(866):     at com.salesforce.androidsdk.rest.BootConfig.readBootConfigFile(BootConfig.java:151)
10-22 18:59:12.489: E/AndroidRuntime(866):     ... 17 more

 

As part of my work with MobileCaddy (http://developer.mobilecaddy,.net) I've put together a version of the MockSmartStore (https://github.com/forcedotcom/SalesforceMobileSDK-Shared/blob/master/test/MockSmartStore.js) that uses localStorage to allow data to persist between sessions during offline / out-of-container development. It seems to be working pretty well and so I was hoping to put in a pull request... before doing so though I wanted to make sure it was fully tested and up-to-scratch.

I'm hoping for some pointers on how the dev env. for working on the MobileSDK itself is set up, is it as easy as cloning, running the tools/grunt and then opening the test HTML page? And also, is there anyway to confirm that all these tests are currently passing?
I've installed the mobileSDK and successfully run the Contact Explorer VFConnector sample apps.  I'm testing if it is possible to use communties for a mobile  app.  I've setup a communitiy, which generates a community login URL.  Is there a way to change the mobile login for the Contact Explorer and/or VF Connector sample apps to point to the community login page?

When I run the sample apps, the default Salesforce login page comes up, which allows you to login to Salesforce and then it will navigate to your Start Page that is specified in the bootconfig.json file.  I'd like to change the login to point to the communities login page instead.  Is this possible?

Thanks.
I am creating 2 apps, one native and one hybrid, using the Salesforce iOS Mobile SDK.
I am trying to create a custom login page instead of the default salesforce login page, is there a way to do that?

I have tried to create a community, and creates a custom login page for it, VF page and Custom Controller.
I then inserted this page's URL in the login url in my mobile app, but it didnt work.
Though this page works fine when from the web.

Is there a way to do a custom login page for Native and Hybrid Apps ???
Hello,

Is it possible to enforce a Session Timeout for Salesforce1 users?  I see under Setup-->Connected Apps-> Salesforce1 --> Mobile Integration there are settings for having a PIN and being able to "Require PIN after" a certain amount of minutes. Would this be the setting I am looking for? What is the difference?

Thanks ahead of time.
Hi ,
 i am creating native app. when i am caling REST API sendAsync for creating record ,record is created sucessfully but i am doesnt get any record id or response back in callback.
Hi All,

I've tried changing the res/xml/servers.xml to point to https://test.salesforce.com/ to no avail.
Everytime I try to log in, it will launch https://login.salesforce.com/ which means I cannot login to my sandbox. I've tried forcing the OAuth2.java file to point to test.salesforce.com also and nothing works.

The server picker also is not visible and thus makes this extremely difficult.

How do I go about solving this?
Hi everyone, 

I use the mobile sdk for android,

and my app doesn't start with the authentication page.

so i need to add a "previous button" so the users can access and leave the authentication standard page given by the mobile sdk,

anyone had the same issue ?

any suggestion of an alternative ?

thank you all,  
Hi All,


I am trying to find an interface to change the login screen size (UIWebView) of Salesforce loing screen on Salesforce Mobile SDK for iOS, can find anything in headers I could play around with. 

Our app ask to login to Salesforce only when view with Chatter feed is loaded and we would like to sqeez the login screen into the same size frame as that particular view. When I was making it work on older version of Salesforce mobile SDK I was able to acomplish that, but can't really recal how I did it (also old SDK could have a bit different approach). Can any of you advice on this?


Thanks a lot,
Justas
Hi All,

I spent quite some time trying figure out this issue, so asking your help please.

I am currently implementing Chatter integration into one of our applications - just after login to Chatter it gets private group feed. We do require ask for login only when user open one of subviews, where data should be displayed (so we don't start login process in AppDelegate as template and examples suggest). Implementation works fine, but when we login for the first time, we get succesful confirmation on login, but begining of url to get the feed generated by SKD has null in the begining of url for the first time we try access it. No matter how many time we will try to call to get a feed, it will be the same invalid url. But If we close the app completely and open it up again, it becomes valid.

So when we try to get the date for the first time after login, we get this:

request:didFailLoadWithError: Error Domain=NSURLErrorDomain Code=-1003 "A server with the specified hostname could not be found." UserInfo=0x12774760 {NSErrorFailingURLStringKey=https://(null)/services/data/v28.0/chatter/feeds/record/0F9D00000000MYi/feed-items/, NSErrorFailingURLKey=https://(null)/services/data/v28.0/chatter/feeds/record/0F9D00000000MYi/feed-items/, NSLocalizedDescription=A server with the specified hostname could not be found., NSUnderlyingError=0xdc44d50 "A server with the specified hostname could not be found."}

As you can see there is missing domain https://(null), but when we close the app, and open it up again, it becomes valid, and is valid every single time after that.


Here's the test call I am making to get the Chatter group feed:

- (void) fetchChatterFeed
{
  
    self.requestChatterFeed= [[SFRestAPI sharedInstance] requestForResources];
  
    self.requestChatterFeed.path = [NSString stringWithFormat:@"%@%@%@%@", self.requestChatterFeed.path, @"/chatter/feeds/record/", CHATTER_GROUP_ID,  @"/feed-items/"];
  
    [[SFRestAPI sharedInstance] send:self.requestChatterFeed delegate:self];
  
}


Am I missing something very obvious here?

Thanks a lot for taking you time to read and understand the question,
Justas
Hi All,

After release of iOS 7.1 SDK it looks like that Xcode does not tolerate Salesforce Mobile SDK not supporting arm64 architecture. App can run well on non 64bits architectures, but once attempted to build for arm64 gives following errors:

Ignoring file /PathToProject/ThirdPartyCode/SalesforceNetworkSDK/libSalesforceNetworkSDK.a, missing required architecture arm64 in file /PathToProject/ThirdPartyCode/SalesforceNetworkSDK/libSalesforceNetworkSDK.a (3 slices)

This happens to follwoing libraries:
  1. libSalesforceOAuth
  2. libSalesforceNativeSDK
  3. libsqlcipher
  4. libSalesforceNetworkSDK
  5. libSalesforceSDKCore
  6. libcrypto
  7. openssl

There was a similar issue with Google Analytics library, so it just required an update to newer version (which supports arm64) and issue was gone. What about Salesforce Mobile SDK. Do we need to wait for the update or can we do something about ourselves?

Thanks a lot for your time people,

J

Hi All,
I have created this app for creating custom login for salesforce in android.But while running I am getting binding error "No account of type com.salesforce.androisdk found" . I don't have any idea what this is about can anyone has any idea can share.. 





public class MainActivity extends SalesforceActivity  {

private RestClient client;
private ArrayAdapter<String> listAdapter;
private static String TAG = "TemplateApp";

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Log.v(TAG," onCreate of Main Activity");
    // Setup view
    setContentView(R.layout.main);
}

@Override
public void onResume() {
    Log.v(TAG," ******* default onResume of Main Activity");
        super.onResume();

        findViewById(R.id.root).setVisibility(View.VISIBLE);
        Log.v(TAG," ******* default onResume - View.INVISIBLE");

        // Login options
        String accountType = SalesforceSDKManager.getInstance().getAccountType();

        Log.v(TAG," ******* default onResume - accountType ::"+accountType);

        LoginOptions loginOptions = new LoginOptions(
                "https://login.salesforce.com/", // login host is chosen by user through the server picker
                SalesforceSDKManager.getInstance().getPasscodeHash(),
                getString(R.string.oauth_callback_url),
                getString(R.string.oauth_client_id),
                new String[] {"api"});
        Log.v(TAG," ******* default onResume - loginOptions ::"+loginOptions);


        // Get a rest client
        new ClientManager(this, accountType, SalesforceSDKManager.getInstance().getLoginOptions(),SalesforceSDKManager.getInstance().shouldLogoutWhenTokenRevoked()).getRestClient(this,
                       new RestClientCallback() {
            @Override
            public void authenticatedRestClient(RestClient client) {

                // Show everything
                findViewById(R.id.root).setVisibility(View.VISIBLE);

              
     if (client == null) {
      SalesforceSDKManager.getInstance().logout(MainActivity.this);
      return;
     }
     onResume(client);

     // Lets observers know that rendition is complete.
     EventsObservable.get().notifyEvent(EventType.RenditionComplete);
    }
   });
            }
   


protected LoginOptions getLoginOptions() {
    Log.v(TAG," getLoginOptions of Main Activity");
    LoginOptions loginOptions = new LoginOptions(
            null, // login host is chosen by user through the server picker
            SalesforceSDKManager.getInstance().getPasscodeHash(),
            getString(R.string.oauth_callback_url),
            getString(R.string.oauth_client_id),
            new String[] {"api"});
    return loginOptions;
}

public void onResume(RestClient client) {
    Log.v(TAG," onResume of Main Activity");
    // Keeping reference to rest client
    this.client = client;

    // Show everything
    findViewById(R.id.root).setVisibility(View.VISIBLE);
}

/**
* Called when "Logout" button is clicked.
*
* @param v
*/
public void onLogoutClick(View v) {
SalesforceSDKManager.getInstance().logout(this);
}

/**
* Called when "Clear" button is clicked.
*
* @param v
*/

public void onClearClick(View v) {
    listAdapter.clear();
}  

/**
* Called when "Fetch Contacts" button is clicked
*
* @param v
* @throws UnsupportedEncodingException
*/

public void onFetchContactsClick(View v) throws UnsupportedEncodingException {
    sendRequest("SELECT Name FROM Contact");
}

public void onFetchAccountsClick(View v) throws UnsupportedEncodingException {
    sendRequest("SELECT Name FROM Account");
}  

private void sendRequest(String soql) throws UnsupportedEncodingException {
    RestRequest restRequest = RestRequest.getRequestForQuery(getString(R.string.api_version), soql);

    client.sendAsync(restRequest, new AsyncRequestCallback() {
        @Override
        public void onSuccess(RestRequest request, RestResponse result) {
            try {
                listAdapter.clear();
                JSONArray records = result.asJSONObject().getJSONArray("records");
                for (int i = 0; i < records.length(); i++) {
                    listAdapter.add(records.getJSONObject(i).getString("Name"));
                }                  
            } catch (Exception e) {
                onError(e);
            }
        }

        @Override
        public void onError(Exception exception) {
            Toast.makeText(MainActivity.this,
                           MainActivity.this.getString(SalesforceSDKManager.getInstance().getSalesforceR().stringGenericError(), exception.toString()),
                           Toast.LENGTH_LONG).show();
        }
    });
}
Hi all,

Do you know if I can use SmartStore with PhoneGap/Cordova on platforms other than iOS and Android? Specifically I will be building for:

Apple OS X
Microsoft Windows 8
Windows Phone

Thanks in advance...

Hi,
I have two hybird mobile apps - one with smartstore and the other just using the Mobile SDK 2.1
With both of them, if I use pin protect then sometimes the app will crash after the pin is entered.

I can avoid the crash after the pin is entered by turning the phone off and on again.

Has anyone a solution to this?
Could anyone tell me how to update the SDK archives in my hybrid app project? I have no idea how to.

I had to make changes to the following code to handle orgs that aren't on the Salesforce.com domain in SFAuthenticationManager:

+ (void)resetSessionCookie
{
    [self removeCookies:[NSArray arrayWithObjects:@"sid", nil]
            fromDomains:[NSArray arrayWithObjects:@".salesforce.com", @".force.com", [SFAccountManager sharedInstance].coordinator.credentials.instanceUrl.host,nil]];
    [self addSidCookieForDomain:@".salesforce.com"];
   
   
    [self log:SFLogLevelDebug format:@"Adding SID for instance domain %@",[SFAccountManager sharedInstance].coordinator.credentials.instanceUrl.host];
    [self addSidCookieForDomain:[SFAccountManager sharedInstance].coordinator.credentials.instanceUrl.host];
}

Hi,

 

When I synchronise the SmartStore with the online database I drop all soups (smartStore.dropAllSoups()) and then recreate them. This seems to make new tables in the SQLite database. However, the previous tables seem to remain and the memory load increases.

 

Is there a way to delete all the 'old' SQLite tables via SmartStore? Alternatively,  what is the location of the SQLite file SmartStore used, so that the database can be cleaned without using SmartStore?

 

Thanks,

 

Hugh

  • November 18, 2013
  • Like
  • 0