GithubHelp home page GithubHelp logo

forcedotcom / salesforcemobilesdk-templates Goto Github PK

View Code? Open in Web Editor NEW
49.0 22.0 59.0 3.46 MB

License: BSD 3-Clause "New" or "Revised" License

Java 3.78% JavaScript 18.87% HTML 0.35% Ruby 1.38% Objective-C 8.57% Swift 29.02% Kotlin 36.91% C 0.07% Shell 0.37% Starlark 0.26% CSS 0.01% Apex 0.04% TypeScript 0.39%

salesforcemobilesdk-templates's Introduction

Build Status

SalesforceMobileSDK-Templates

Use the forceios/forcedroid/forcehybrid/forcereact or sfdx with sfdx-mobilesdk-plugin to create a new application based on one of the template.

salesforcemobilesdk-templates's People

Contributors

bbirman avatar bhariharan avatar brandonpage avatar gkotula avatar helenren avatar ivansfdc avatar jamesward avatar jiwansvmx avatar johnsonericatsalesforce avatar svc-scm avatar wmathurin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

salesforcemobilesdk-templates's Issues

Enhancement : Nested Query should be work

Hi Team,

I have found the issue in SalesforceMobileSDK the nested query is not working. I would appreciate if you guys can fix this issue in SDK so that nested query should work.

Thanks,
Ashish

MobileSyncExplorerReactNative: Login after being logged out result in Fatal error

Installed templated. After being logged out (oauth.logout()), I try to relogin with a different account. The app will then throw a fatal error and metro bundler is constantly restarting and looping constantly.

Salesforce Mobile SDK v8.1
React Native v0.61

Steps to reproduce

  1. Installed template MobileSyncExplorerReactNative using forcereact
  2. start bundler npm run start
  3. build ios app npx react-native run-ios
  4. Login screen appears, login with a credential
  5. Click on the logout button (upper right)
  6. Login screen re-appears, enter credential of different user
  7. Ios app throws fatal error. Bundler is constantly restarting.

Can't build ios project after running forcereact create

I'm not able to build the Salesforce React-native project after creating forcereact create.

Here is the command line that i used to create the project:
forcereact create --platform=ios,android --appname=CoolReact --packagename=com.test.my_new_app --organization="Acme Widgets, Inc." --outputdir=CoolReact
This command run fine after all. There is no error throwing

Here is what's about the error throw after i open the ios proejct via .xcworkspace file and build:
Ld /Users/huyvu/Library/Developer/Xcode/DerivedData/CoolReact-ggmknehqtfibaccifesgdlgestia/Build/Products/Debug-iphonesimulator/RNScreens/RNScreens.framework/RNScreens normal (in target 'RNScreens' from project 'Pods') cd /Users/huyvu/Workplaces/CoolReact/ios/Pods /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -target x86_64-apple-ios9.0-simulator -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk -L/Users/huyvu/Library/Developer/Xcode/DerivedData/CoolReact-ggmknehqtfibaccifesgdlgestia/Build/Products/Debug-iphonesimulator/RNScreens -F/Users/huyvu/Library/Developer/Xcode/DerivedData/CoolReact-ggmknehqtfibaccifesgdlgestia/Build/Products/Debug-iphonesimulator/RNScreens -F/Users/huyvu/Library/Developer/Xcode/DerivedData/CoolReact-ggmknehqtfibaccifesgdlgestia/Build/Products/Debug-iphonesimulator/DoubleConversion -F/Users/huyvu/Library/Developer/Xcode/DerivedData/CoolReact-ggmknehqtfibaccifesgdlgestia/Build/Products/Debug-iphonesimulator/Folly -F/Users/huyvu/Library/Developer/Xcode/DerivedData/CoolReact-ggmknehqtfibaccifesgdlgestia/Build/Products/Debug-iphonesimulator/React-Core -F/Users/huyvu/Library/Developer/Xcode/DerivedData/CoolReact-ggmknehqtfibaccifesgdlgestia/Build/Products/Debug-iphonesimulator/React-cxxreact -F/Users/huyvu/Library/Developer/Xcode/DerivedData/CoolReact-ggmknehqtfibaccifesgdlgestia/Build/Products/Debug-iphonesimulator/React-jsi -F/Users/huyvu/Library/Developer/Xcode/DerivedData/CoolReact-ggmknehqtfibaccifesgdlgestia/Build/Products/Debug-iphonesimulator/React-jsiexecutor -F/Users/huyvu/Library/Developer/Xcode/DerivedData/CoolReact-ggmknehqtfibaccifesgdlgestia/Build/Products/Debug-iphonesimulator/React-jsinspector -F/Users/huyvu/Library/Developer/Xcode/DerivedData/CoolReact-ggmknehqtfibaccifesgdlgestia/Build/Products/Debug-iphonesimulator/Yoga -F/Users/huyvu/Library/Developer/Xcode/DerivedData/CoolReact-ggmknehqtfibaccifesgdlgestia/Build/Products/Debug-iphonesimulator/glog -filelist /Users/huyvu/Library/Developer/Xcode/DerivedData/CoolReact-ggmknehqtfibaccifesgdlgestia/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RNScreens.build/Objects-normal/x86_64/RNScreens.LinkFileList -install_name @rpath/RNScreens.framework/RNScreens -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -dead_strip -Xlinker -object_path_lto -Xlinker /Users/huyvu/Library/Developer/Xcode/DerivedData/CoolReact-ggmknehqtfibaccifesgdlgestia/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RNScreens.build/Objects-normal/x86_64/RNScreens_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -framework Foundation -framework React -Xlinker -no_adhoc_codesign -compatibility_version 1 -current_version 1 -Xlinker -dependency_info -Xlinker /Users/huyvu/Library/Developer/Xcode/DerivedData/CoolReact-ggmknehqtfibaccifesgdlgestia/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RNScreens.build/Objects-normal/x86_64/RNScreens_dependency_info.dat -o /Users/huyvu/Library/Developer/Xcode/DerivedData/CoolReact-ggmknehqtfibaccifesgdlgestia/Build/Products/Debug-iphonesimulator/RNScreens/RNScreens.framework/RNScreens

Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_RCTImageLoader", referenced from: objc-class-ref in RNSScreenStackHeaderConfig.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

I'm really appreciate if anyone have any ideas why this is happening? I tried to remove pod folder and run pod install but it has same issue after all

React Native appdelegate.m file uses old approach to js bundle location

The template for React Native apps on iOS currently requires the user to comment/uncomment different lines of code to switch the js bundle location from the development server to the on-device packaged version. The standard template for react native apps has a different mechanism where the js bundle location is tied to which build configuration is being run, which is much easier to work with (and is already the way the Android build works). It looks like this was switched over quite a while back, around react native version 0.29.

Would it be possible to switch the appdelegate.m file in the SDK template to use the new approach? This would also make it much easier to install other react native libraries that modify the appdelegate.m file, as the installation steps typically expect the file to be based on the new template.

createWithTemplate results in error

`$ forceios createWithTemplate
Enter URI of repo containing template application: /Users/syedtariq/icloud/Documents/GitHub/SalesforceMobileSDK-Templates
Enter your application name: SFTest3
Enter the package name for your app (com.mycompany.myapp): com.syedtariq.SFTest3
'com.syedtariq.SFTest3' is not a valid package name.
Enter the package name for your app (com.mycompany.myapp): com.syedtariq.sftest3
Enter your organization name (Acme, Inc.): clearesult
Enter output directory for your app (leave empty for the current directory):
forceios failed

Path must be a string. Received undefined`

iOS 13 template does not map Accounts correctly

After I've created project I cannot see in ui any records but from debug I can see that I fetch them
I assume loadFromSmartStore func havent called or it mapped contacts in wrong way

Steps to reproduce:

  1. Create project with iOS 13 swift template;
  2. Change token and cb url
  3. launch app

Switch user problem with SceneDelegate

Hi.

I am working on a iOS project where we use both AppDelegate and SceneDelegate. I ran into a interesting trouble that if I switch to another user, both users Contacts will be shown in the app. (If user A has 10 contacts and user B 20 contacts, all 30 contacts are shown after switching user and resyncing data). It is very annoying problem I am having trouble to fix, so I wanted to ask if there is a possibility for you to make a sample how to set up a project with AppDelegate and SceneDelegate so that syncing works correctly after switching user.
We use MobileSyncExplorerSwift as a template.

Repo in detached state

While creating project with forceios createwithtemplate --templaterepouri=iOSNativeSwiftTemplate forceios uses detached branch with message:

Note: switching to 'cb3dcb63f261fda472ca9f0a96b34002b346342a'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

Couldn't refresh token issue

Hello Team,

We are creating Android and iOS Native app using React Native Framework v0.50.4. We are stuck in an issue described as below.

We are consistently getting 'Could not refresh token' error from Salesforce mobile sdk on production environment during syncing process. The same is working fine on Sandbox environment. We have also created Connected Apps on both the environments.

We have taken a template from https://github.com/forcedotcom/SalesforceMobileSDK-Templates/tree/master/SmartSyncExplorerReactNative

We have also posted the same issue on SalesforceMobileSDK Google group but didn't find the resolution to fix this issue.
You can find the url below :
https://plus.google.com/108862923721534440328/posts/hDUMZRucG6Z
Salesforce SDK version 6.2
React Native version 0.55.4

There is a Poor Error handling on SalesforceMobileSDK due to which we are not able to find the exact issue, we are only getting couldn't refresh token all the time.

I would really appreciate if you could help me out to resolve this issue.

Regards,
Vantage

forceios createWithTemplate failing

I'm trying to create a template App using forceios but this is failing during pod dependencies installation.
forceios version-6.2.0
npm veriosn - 5.6.0

$ forceios createwithtemplate --templaterepouri=https://github.com/forcedotcom/SalesforceMobileSDK-Templates/MobileSyncExplorerSwift
Enter your application name: SDKSample
Enter your package name: com.bestapp.ios
Enter your organization name (Acme, Inc.): bestapp.com
Enter output directory for your app (leave empty for the current directory):

/Users/mr0perfect/SDKSample /Users/mr0perfect
Installing sdk dependencies
Cloning into 'mobile_sdk/SalesforceMobileSDK-iOS'...
remote: Enumerating objects: 1063, done.
remote: Counting objects: 100% (1063/1063), done.
remote: Compressing objects: 100% (961/961), done.
remote: Total 1063 (delta 464), reused 261 (delta 72), pack-reused 0
Receiving objects: 100% (1063/1063), 26.45 MiB | 2.93 MiB/s, done.
Resolving deltas: 100% (464/464), done.
Note: checking out '33181112f6c284285a0132897fc6b24988aedff2'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

git checkout -b

Installing pod dependencies
Update all pods
Updating local specs repositories
Cloning spec repo cocoapods- from https://cdn.cocoapods.org/
[!] Unable to add a source with url https://cdn.cocoapods.org/ named cocoapods-.
You can try adding it manually in ~/.cocoapods/repos or via pod repo add.

/Users/mr0perfect
forceios failed

Command failed: pod update

SmartSyncExplorerReactNative throws redbox on scrolling

I just tried the SmartSyncExplorerReactNative sample app. It works fine, but throws a redbox when scrolling down the list of contacts (the org I am connecting to has over 10K contacts).

Doing some digging in the code, it looks like the cursor object passed in to smartstore.moveCursorToPageIndex doesn't get deserialized properly, resulting into a 101th element in the accumulatedResults array with an undefined value.

To repro, follow these steps:

  1. Connect to an org with more than pagesize (=100?) contacts.
  2. Scroll down the list to the last item.
  3. RN throws the following error:

simulator screen shot - iphone 6 - 2019-02-13 at 21 08 15

React Native Template does not have auto linking for ios

When creating a new react-native app using forcereact, then the podfile does not include the necessary changes as described (here)[https://reactnative.thenativebits.com/courses/upgrading-react-native/upgrade-to-react-native-0.60/]

When I add a library using npm install --save <package-name and run pod install the newly added package is not added.

Steps to reproduce

  1. Create a new app using forcereact createWithTemplate --templaterepouri=ReactNativeTemplate
  2. Browse the folder of the app
  3. run npm install --save react-native-camera
    This package supports autolinking
  4. run npx pod-install

After running the last command you'll see that no pods are linked.

How to see my contacts from salesforce

I installed an app, logged in and it works correctly. When I sign in to salesforce website, I can see I have few contacts. But when I sign in in a mobile app (react-native) I don't see any contacts. And if I create a contact it's not saving to my account.

Connected App Issue

Hi Team,

We are developing a react native app and we are using okta in the backend and connected app of salesforce.
Salesforce SDK version 6.2
React Native version 0.55.4

We have two environments :

  1. Sandbox
  2. Production

We are creating both the builds with the different consumer key and callback URL for both the environments.
The issue we are facing in a sandbox build is we are able to log in with prod credentials and vice versa.

I guess this should not be the expected behavior.

We have also posted the same issue on SalesforceMobileSDK Google group but didn't get any reply yet.
You can find the url below :
https://plus.google.com/101752486167332519908/posts/JJfpiSoZU9B

Thanks,
Ashish

iOS build fails

Hi,
I'm getting this failure when i run the project in Xcode.

Steps to regenrate:-

  1. Create project with "forcereact createwithtemplate"
  2. Open the .xcworkspace file in ios directory
  3. run project

Screenshot 2021-02-04 at 2 10 50 PM

@bhariharan @wmathurin

"Can't find variable: oauth" error when signing out

MobileSyncExplorerReactNative project
When I try to use the logout button in the SearchScreen, I get the following error:
ReferenceError: Can't find variable: oauth
onPress
SearchScreen.js:159:50
...
Fix:
Added the following import statement on line 36 of SearchScreen:
import {oauth} from 'react-native-force';

How to popup soup through REST API

i am integrating salesforce with react native for the first time, I am using forcereact command. I want to popup soup through REST API, I referred this link but they have mentioned only hybrid apps and native apps.
Can anyone guide me how I can call REST API. For example in following function I want to call REST API

function syncUpContacts() {
	if (syncInFlight) {
		console.log("Not starting syncUp - sync already in fligtht");
		return Promise.resolve();
	}

	console.log("Starting syncUp");
	syncInFlight = true;
	const fieldlist = [
		"FirstName",
		"LastName",
		"Title",
		"Email",
		"MobilePhone",
		"Department",
	];
	return syncUp(false, {}, "contacts", {
		mergeMode: mobilesync.MERGE_MODE.OVERWRITE,
		fieldlist,
	}).then(() => {
		console.log("syncUp completed or failed");
		syncInFlight = false;
		emitSmartStoreChanged();
	});
}

[Question] How to login to Community React Native

I've been digging around in the iOS code (have not tried android yet) trying to figure out how to login into a community site. I am able to change the SFDCOAuthLoginHost in the info.plist to my community login url (-developer-edition.na53.force.com/login), and I can see that is builds the auth url with that host. But it goes through the brandedAuthorizeURL method, which tacks /services/oauth2/authorize?... onto the url, which sends the login page to a not found page. I just want to hit <my community>-developer-edition.na53.force.com/login and auth through the community site. Is there a way to do this or is it not supported?

[Question] ReactNative Android won't build if other deps are brought in

This is more of a question than an issue, but if you create a react native android app with latest release, it builds fine and runs without issue. If you try to bring in a react native dependency and link it, like react-native-camera or rn-fetch-blob, the android build fails with errors around not finding symbols like ExifInterface and different annotations. The different android.support packages do not seem to exist in the project. Here is a failure from one of my builds

.../testapp/node_modules/rn-fetch-blob/android/src/main/java/com/RNFetchBlob/RNFetchBlob.java:9: error: package android.support.v4.content does not exist
import android.support.v4.content.FileProvider;
                                 ^
.../testapp/node_modules/rn-fetch-blob/android/src/main/java/com/RNFetchBlob/Response/RNFetchBlobFileResp.java:3: error: package android.support.annotation does not exist
import android.support.annotation.NonNull;
                                 ^
.../testapp/node_modules/rn-fetch-blob/android/src/main/java/com/RNFetchBlob/RNFetchBlobBody.java:3: error: package android.support.annotation does not exist
import android.support.annotation.NonNull;
                                 ^
.../testapp/node_modules/rn-fetch-blob/android/src/main/java/com/RNFetchBlob/RNFetchBlobReq.java:11: error: package android.support.annotation does not exist
import android.support.annotation.NonNull;
                                 ^
.../testapp/node_modules/rn-fetch-blob/android/src/main/java/com/RNFetchBlob/Response/RNFetchBlobFileResp.java:80: error: cannot find symbol
        public long read(@NonNull Buffer sink, long byteCount) throws IOException {
                          ^
  symbol:   class NonNull
  location: class RNFetchBlobFileResp.ProgressReportingSource
.../testapp/node_modules/rn-fetch-blob/android/src/main/java/com/RNFetchBlob/RNFetchBlobBody.java:118: error: cannot find symbol
    public void writeTo(@NonNull BufferedSink sink) {
                         ^
  symbol:   class NonNull
  location: class RNFetchBlobBody
.../testapp/node_modules/rn-fetch-blob/android/src/main/java/com/RNFetchBlob/RNFetchBlob.java:112: error: cannot find symbol
            Uri uriForFile = FileProvider.getUriForFile(getCurrentActivity(),
                             ^
  symbol:   variable FileProvider
  location: class RNFetchBlob
.../testapp/node_modules/rn-fetch-blob/android/src/main/java/com/RNFetchBlob/RNFetchBlobReq.java:347: error: cannot find symbol
                public Response intercept(@NonNull Chain chain) throws IOException {
                                           ^
  symbol: class NonNull
.../testapp/node_modules/rn-fetch-blob/android/src/main/java/com/RNFetchBlob/RNFetchBlobReq.java:409: error: cannot find symbol
                public void onFailure(@NonNull Call call, IOException e) {
                                       ^
  symbol: class NonNull
.../testapp/node_modules/rn-fetch-blob/android/src/main/java/com/RNFetchBlob/RNFetchBlobReq.java:426: error: cannot find symbol
                public void onResponse(@NonNull Call call, @NonNull Response response) throws IOException {
                                        ^
  symbol: class NonNull
.../testapp/node_modules/rn-fetch-blob/android/src/main/java/com/RNFetchBlob/RNFetchBlobReq.java:426: error: cannot find symbol
                public void onResponse(@NonNull Call call, @NonNull Response response) throws IOException {
                                                            ^
  symbol: class NonNull
Note: .../testapp/node_modules/rn-fetch-blob/android/src/main/java/com/RNFetchBlob/RNFetchBlobUtils.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
11 errors

I suspect it has something to do with AndroidX and Jetpack but not sure how to resolve the issue. Any body else experience this or have any work around?

How to sync up/down Salesforce Files(ContentDocument) via Mobile App

Hi Team,

We are trying to implement usecase in mobile app, where user will upload attachments against Campaign record and would like to store it in Salesforce as Files(ContentDocument/ContentDocumentlink/Version) instead classic Attachment object record. Howere, we observed below issues while implement it.

  1. ContentDocument/ContentDocumentlink/Version not supported for smartStore/smartsync attachment data
  2. No offline support

Could you please let us know, how we will achieve this usecase to support in online/offline mode?

SDK version: 8.2.0
React-native version: 0.63.2
React version: 16.11.0

Best Regards,
-Vivek

Please update to more recent node version

Trying to run forcedroid and getting this error:

Missing tools

Installed node version (10.9.0) is more than the maximum supported version (8.11). Please downgrade your version of node.

Delaying Authentication iOS

It appears that setting

<key>shouldAuthenticate</key>
	<false/>

in the bootconfig.plist should prevent the login screen from launching on app init, but that does not seem to be the case. How do you prevent the login screen from launching on init? This worked prior to the v7.0.0 release, but it was all handled in the AppDelegate file?

Pod install gives no pod spec found error on native swift template

Hi @bhariharan,

Please find the below error when i run pod install in the native swift template Ankita-Porwal:iOSNativeSwiftTemplate ankita$ pod install
Analyzing dependencies
Pre-downloading: PromiseKit from https://github.com/mxcl/PromiseKit, tag 5.0.3
Fetching podspec for SalesforceAnalytics from mobile_sdk/SalesforceMobileSDK-iOS
[!] No podspec found for SalesforceAnalytics in mobile_sdk/SalesforceMobileSDK-iOS
Ankita-Porwal:iOSNativeSwiftTemplate ankita$

I need your help resolve this issue

Thanks,
AP

Remote access consumer key

Hey!
Got a question!
Our company got a product on app exchange and we've want to build native app. How we could implement dynamic access key so users could login at any org? any ideas?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.