You need to sign in to do that
Don't have an account?
Getting started with Hybrid Development challenge not completed
I'm pretty sure I have created a hybrid mobile app - but I still get this message 'Challenge Not yet complete... here's what's wrong: You haven't run and logged in from the 'TrailheadHybridTest' app.' I created a new Dev org and logged in to the app OK but Trailhead won't let me pass this challenge.
I had the same issue. Here is what I did to solve:
1. Create Application type: hybrid_local following the example in the trailhead
2. I use the js which is indicated in the step 3 of the project 'Build Hybrid Apps with the Mobile SDK' (https://developer.salesforce.com/trailhead/project/mobile-sdk-hybrid-apps/mobilesdk-hybrid-apps-02)
3. The callbacks URL in the Connected App in Salesforce are: trailheadapp://auth/success and http://localhost:8200/oauthcallback.html
4. I set 'bootconfig.json' with my remoteAccessConsumerKey and oauthRedirectURI (trailheadapp://auth/success)
5. Launch the cordova project in the app's 'www' directory with 'force-server' instruction to load your app in a browser window (make sure you haven't pop-up window blocked)
6. Allow Salesforce permission and it will show a list of contacts.
With this, you can pass the chanllenge, but it doesn't function correctly because it doesn't use the Visualforce Page you created for the challenge.
Regards.
I think I know the reson - even though the app is named as mentioned in the Trailhead challenge, it is still visible in the system as "SampleMobile SDK Sample App". You can check it in the user's login history (Application column).
I've checked all the configurations and even searched for mentioned phrase in all the project files but with no results :(
Anyone knows how to force android to authenticate with the name of the app / package itself instead of that dummy name?
Thanks, Laura
As Emil states, on Salesforce i see "SampleMobile SDK Sample App".
Anyone managed to solve on same device facing the issue?
Kind regards,
Aitor.
Regards,
Yan.
Were you able to pass the challenge? I'm having the same issue.
Regards,
Michele
Key to making this work and isn't mentioned: the cordova app must be built via the cordova command. After creating all of required artifacts, enter the following in the same terminal that was used to create the Hybrid app.
cordova build <the target os>
npm install -g <target os>-sim
cordova emulate <target os>
For iOS, this would be:
cordova build ios
npm install -g ios-sim
cordova emulate ios
The reason for this is the app is signed during the build process using the salesforce creditinals provided. Without signing, salesforce won't fully acknowalge the log in from the app. The signing done by Xcode is for Apple's appstore, which is something different alotogether.
In \res\values\strings.xml, you need to change the value of the first resource/string.
1. In Android Studio, use Ctrl + Shift + F to launch the "Find in Path" dialog.
2. Search for "<string name="app_name">"
3. Change the contents of the XML element to "TrailheadHybridTest"
(Tip: If you go to the "Preview" tab, you can do this directly in the "Find dialog"!)
The strings.xml should now read:
You will need to delete permission for your application to log in from your emulated device so that the application itself will ask you for permission again. Otherwise (if for example, you just log out from the HybridPage) your login will be recorded as a browser login, not an application login.
Somehow when building the project the builder ignores all the folders under android platform, so you will need to remove android platform and readd it by the following command lines
If you see a message saying that the version of cordova-android doesn't support com.salesforce plugin, re-remove android and add the version required. After that remove com.salesforce plugin and readd it.
For example:
If that solved the problem, apart from being able to complete the challenge, you will be able to see your log history with Trailhead Hybrid as the application name.
This will also remove the double log in screen, surely because we were doing a wrong request.
Seems that "SampleMobile SDK Sample App" cannot be used with DEV-Env. Poor Tutorial....
"startPage": "HybridPage",
to
"startPage": "apex/HybridPage",
If you're having a hard time completing the challenge eventhough you HAVE technically completed it do this:
- Create the Connected App as is said in the hybrid challenge and the Visualforce Page (you can leave it empty):
- Create a native iOS (or android) app with the name TrailheadHybridTest. And do the steps to set it up that are described in the Native app modules (if you use an android use the first challenge in the Native Android Module and if you're using iOS use the first challenge in the Native iOS Module).
- When you login it should say you logged in with an app that has the correct name and allow you to pass...
I am facing several issues in this module. Please someone can list out the exact steps and commands that can work? Really frustrated after working more than 20 hours on this bloody module.
1. The version mentioned in the trail isn't working properly and have bugs (as per stackexchange). It gives errors like package names should be x[.y.[. etc. Also same issue when it asks to create the page name.
2. I do not see the BOOTCONFIG file (no relevant file in any directory).
3. Even if I'm able to create the app git import doesn't finish and errros out showing there is is deference in versions.
Thanks in advance,
Yogesh
did someone find the way to pass this challenge? I find the same issue both on Get Started with Native Android Development and Getting started with Hybrid Development. In both cases my login shows "SalesforceMobileSDK Sample App" instead of the correct app name, and the challenge test fails. I miss only those 2 modules to finish my trailhead path to Dreamforce :)
Any suggestions?
thank you
Gemma
Since I'm not a developer, I followed carefully the instructions gave into the module:
- created the mobile app through command "forcedroid create" in my command line (not GIT command)
- created the connected app in my Dev Edition environment with all the recommended settings
- updated the consumer key and callback URL in "my path\mobile_sdk\salesforcemobilesdk-android\native\NativeSampleApps\SmartSyncExplorer\res\bootconfig.xml" (and in the related file for hybrid)
- imported the app in Android Studio
- ran the app on my mobile
I can successfully log into the app, but into the login history of my profile in salesforce I find the access from a "SalesforceMobileSDK Sample App" that probably causes the error.
I also tried to find <string name="app_name"> with the wrong value, as suggested, but mine are already correct...
thank you
G.
after days and nights spent on these modules I found the way to pass the ckeck.
In both cases (Android and Hybrid) the only thing I had to do was updating ALL the bootconfig files existing in the project, that wasn't so clear to me.
Thank you anyway for you support.
Gemma
@shukla Yogesh, are you still available to help? I'm facing a similar problem during this challange. I'm not seeing the file I have to edit and I think there is an issue with the Cordova plugins that I just can't figure out. I have followed every step in the lesson and I was able to pass the Windows native challenge, but not this one. I get an error on the forcedroid create saying it failed. I have tried multiple times and at one point I saw two bootconfig files in the folder created, which I edited both with the call back URL and the key, however, the App did not work properly. Any help you, or any other developer out there could provide is greatly appreciated.
Thanks,
Chris.
This was crazy as well - I spend almost all day yesterday and all day today to actually get mine work. After no success with IOS XCODE asking me to set up a developer profile and enroll in a dev program, I decided to go the route of Android.
Steps:
1. Open the application in Android Studio - Bypassed :
Gradle sync failed: Failed to find Build Tools revision 26.0.0 Consult IDE log for more
2. Opened the bootconfig.json file under www folder and noticed that first two parameters were not updated as per the tutorial
* Updated remoteAccessConsumerKey vlaue to my Consumer Key value of my Connected App
* Updated oauthRedirectURI value to suggested value in tutorial ("trailheadapp://auth/success")
3. Cleaned the project
4. Rebuilt
5. Voila! Was able to log into my Salesforce and validate the challenge to claim points
Please follow the link :
https://medium.com/@richard_whitley/tips-for-passing-mobile-sdk-trailhead-challenges-eba51ab90296
As per this tutorial i found my bootconfig.json file on below path :
<app_path>\platforms\android\app\src\main\assets\www
Now it is taking "trailhead hybrid" connected app to get access.
This occurs if you:
1. create the hybrid local app
2. change into the directory
3. edit the two files as instructed
5. open in Android Studio
6. build
7. test
In those steps, notice that cordova prepare is missing from #4. This will result in building the app with the default SDK Connected App ID and hence the problem.
Simply add cordova prepare command, in the base directory, right after editing the two files in www. This will propegate the Connected App ID into the right place in the android or iOS files and voila.
Note if you've gotten this error, you'll need to go to the SDK OAuth usage and revoke all - this will revoke all with that connected app ID and then when you launch the app again, it should re-authenticate with the correct Connected App ID and the Trailhead will pass.
I got this issue, read all the above comments, figured this is what happened, and was then able to get the 500 points. Woohoo!
I'm using PC and Android Studio and fixed this by doing the following;
Thanks to Diana Mann for the above Comment.