-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make projectID and preview API configurable #145
Conversation
@@ -81,6 +82,14 @@ protected void onCreate(Bundle savedInstanceState) { | |||
// TODO: seems like this is not required after all, verify and remove if possible | |||
//AndroidNetworking.initialize(getApplicationContext()); | |||
|
|||
String customProjectId = getIntent().getStringExtra("KontentProjectId"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where does those come from? I mean are you sending them from some other activity? I think that you wanted to grab those from strings.xml, however then you need to use this: https://developer.android.com/guide/topics/resources/string-resource#String and I think there must be a default value. xml
file. Also please add how to use CustomProjectId into readme
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to use it in combination with appetize: https://docs.appetize.io/core-features/playback-options -> a will add section to README.
Default value is null if nothing is set -> hence condition right under that.
INSTANCE = client; | ||
} | ||
return INSTANCE; | ||
} | ||
|
||
private static DeliveryClient resetClient(String previewAPiKey) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't initializeClient
be a better name? :) if I am reading it in BaseActivity.java
it sounds better to me that: if customprojectId is not null then initializeClient. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
renamed
Requested changes:
|
I think the code is fine - it is a sample..
|
Motivation
Internal link: DEVREL-694
Make the project Id and preview API key configurable. Currently using getIntent.getStringExtra().
Checklist
How to test
If manual testing is required, what are the steps?