the plugin works in debug mode but in release mode it doesnt connect.
here is my code:
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:flutter/material.dart';
import 'package:flutter_tapjoy/flutter_tapjoy.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:smilenow/Scoped_model/main.dart';
if(amount!=0&&amount!=null){
Firestore.instance.collection("User").document(widget.model.userId).get().then((value){
value.reference.updateData({
"diamonds":value.data['diamonds']+amount
});
if(amount!=0){
Firestore.instance.collection("history").add({
"diamonds":amount,
"email":widget.model.uemail,
"type":"TapJoy Offerwall",
"dt":DateTime.now()
});
}
TapJoyPlugin.shared.spendCurrency(amount);
});}
};
return handler;
break;
case TJContentState.contentDidAppear:
print(contentState);
break;
case TJContentState.contentDidDisappear:
setState(() {
ready=false;
});
break;
case TJContentState.contentRequestSuccess:
ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text("Requesting Tapjoy")));
break;
case TJContentState.contentRequestFail:
setState(() {
ready=false;
});
ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text("Request Failed")));
break;
case TJContentState.userClickedAndroidOnly:
setState(() {
ready=false;
});
break;
}
};
return handler;
// add placements.
TapJoyPlugin.shared.addPlacement(myPlacement);
// set currency Handlers
TapJoyPlugin.shared.setGetCurrencyBalanceHandler(_currencyHandler());
TapJoyPlugin.shared.setAwardCurrencyHandler(_currencyHandler());
TapJoyPlugin.shared.setSpendCurrencyHandler(_currencyHandler());
TapJoyPlugin.shared.setEarnedCurrencyAlertHandler(_currencyHandler());
},
child: Card(
elevation:10,
child:Container(
height: 100,
width: MediaQuery.of(context).size.width/2-25,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(4)),
//color: Colors.white,
),
child: ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(8)),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Row(
children: [
SizedBox(width: 10,),
Container(
height: 80,
width: 80,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(16)),
color: Color(0xffbff5400),
),
child: Icon(Icons.stars_outlined,size: 48,color: Colors.white,),
),
SizedBox(width: 10,),
Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text("Max Task",style: GoogleFonts.bebasNeue(
textStyle: TextStyle(
color: Colors.black,fontSize: 24,letterSpacing: 1,
fontWeight: FontWeight.normal,
)
),),
Text("Complete Max Task",style: GoogleFonts.bebasNeue(
textStyle: TextStyle(
color: Colors.black,fontSize: 18,letterSpacing: 1,
fontWeight: FontWeight.normal,
)
),),
],
),
Spacer(),
CircleAvatar(
backgroundColor: Colors.grey[300],
child: IconButton(onPressed: (){
TapJoyPlugin.shared.getCurrencyBalance();
if(ready==true){
myPlacement.showPlacement();
}else{
myPlacement.requestContent();
}
}, icon: Icon(Icons.arrow_forward_ios_sharp,color: Colors.grey[500],size: 28,)),
),
SizedBox(width: 15,),
],
),
],
)
),
),
),
);